This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner classe

 
Nisheeth Kaushal
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5382
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gurpreet Sachdeva
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic