aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner Classes and Access Modfiers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner Classes and Access Modfiers" Watch "Inner Classes and Access Modfiers" New topic
Author

Inner Classes and Access Modfiers

Chris Gastin
Ranch Hand

Joined: Aug 13, 2002
Posts: 51
I have been searching this message board, on this topic, and i ahve to admit I am sort of confused. Could someone answer the following questions to clarify for me.
What access modfiers can be used with Static Inner Classes?
What access modfiers can be used with Member Inner Classes?
What access modfiers can be used with Local Inner Classes?


Chris Gastin<br />SCJP 1.4<br />SCWCD 1.3
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
What access modfiers can be used with Static Inner Classes?
If you are refering to top level nested class (static), then it can have all available access modifiers.
What access modfiers can be used with Member Inner Classes?
If you are refereing to Non-static inner class, again answere is same.
What access modfiers can be used with Local Inner Classes?
None
[ September 10, 2002: Message edited by: Barkat Mardhani ]
Sabarish Sasidharan
Ranch Hand

Joined: Aug 29, 2002
Posts: 73
Consider static nested top level classes to be like normal static members you have in ur class(like static variables and static methods). Hence they can have all the access modifiers applicable to static members.
Similarly nonstatic inner classes are similar to the instance members we have in classes and hence enjoy all the access modifiers applicable to nonstatic innner classes.
Local inner classes are just like local variables and similar to the local variables they do not have any access modifiers.
Hope this helps


Sab<br /> <br />Perfection does not come from belief or faith. Talk does not count for anything. Parrots can do that. Perfection comes through selfless work.<br />Swami Vivekananda
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner Classes and Access Modfiers