Inner class

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2008
Posts: 28
Reputation: Parsu7 is an unknown quantity at this point 
Solved Threads: 1
Parsu7 Parsu7 is offline Offline
Light Poster

Inner class

 
0
  #1
Mar 9th, 2008
Is it necessary to declare an inner class private?If it is then plz specify the reason why is it necessary to declare an inner class private?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,293
Reputation: majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about majestic0110 has a spectacular aura about 
Solved Threads: 67
majestic0110's Avatar
majestic0110 majestic0110 is offline Offline
Nearly a Posting Virtuoso

Re: Inner class

 
0
  #2
Mar 9th, 2008
an inner class can have any modifier (eg public, private etc)
http://java.sun.com/docs/books/tutor...erclasses.html
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,619
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 468
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Inner class

 
0
  #3
Mar 9th, 2008
> Is it necessary to declare an inner class private?

No. Here is some information which you would find useful when learning about Inner Classes.

EDIT: Too slow.
Last edited by ~s.o.s~; Mar 9th, 2008 at 3:13 pm.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 8
Reputation: madhusamala is an unknown quantity at this point 
Solved Threads: 1
madhusamala madhusamala is offline Offline
Newbie Poster

Re: Inner class

 
0
  #4
Mar 10th, 2008
An inner class is nothing but a member of its enclosing class. Any member of class can be declated with access modifiers like public, private, protected.
Access modifiers make the member to be visible to others or not
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Inner class

 
0
  #5
Mar 10th, 2008
though depending on what you want to use it for it may or may not require the static attribute.
That's the only one that in some cases is dictated.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC