wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner classe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner classe" Watch "Inner classe" New topic
Author

Inner classe

Nisheeth Kaushal
Ranch Hand

Joined: Jul 20, 2001
Posts: 87
Hi all,
Can anyone provide me with the list of modifier that variables of a class and is accessible to static inner classes and inner classes.
Is it true that static inner class can only access fianl variables of the outer class.
Nisheeth.
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
Originally posted by Nisheeth Kaushal:
Hi all,
Can anyone provide me with the list of modifier that variables of a class and is accessible to static inner classes and inner classes.
Is it true that static inner class can only access fianl variables of the outer class.
Nisheeth.


1. non static inner classes can access all(private, protected, public) members of outer class.
2. static classes can access all static members of outer classes.(can not access non static members).
3. inner classes in side the member method can access all members of outer class and only final arguments of the method.
CMIW (correct me if wrong)

------------------
Regards
Ravish


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Gurpreet Sachdeva
Ranch Hand

Joined: Feb 20, 2001
Posts: 90
Hello Kaushal,
I have created a chart of all the variables that can be used with inner classes and it is available here.
Regards
Gurpreet Sachdeva
For Mock Exams, FAQ and some useful information about Bitshift operator, inner classes, garbage collection,etc please visit: http://www.go4java.20m.com


Regards<BR>Gurpreet Sachdeva<P>For Mock Exams, FAQ, Exam tips and some useful information about Bitshift operator, inner classes, garbage collection,etc please visit: <A HREF="http://www.go4java.lookscool.com" TARGET=_blank rel="nofollow">http://www.go4java.lookscool.com</A>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner classe