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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner Classes" Watch "Inner Classes" New topic
Author

Inner Classes

Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 166
Can any one tell why is Static members ( variables + methods ) not allowed in Inner classes ??
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Greetings Oohri ,

Static members are allowed in the inner classes , provided you keep the inner class static as well. Inner classes can be declared static


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 166
Saif Asif wrote:Greetings Oohri ,

Static members are allowed in the inner classes , provided you keep the inner class static as well. Inner classes can be declared static


Thanks Asif
Nancy Avent
Ranch Hand

Joined: Feb 23, 2013
Posts: 94
I am reading OCPJP 7 book by Ganesh/Sharma and I must say that the topic about Inner classes is superbly written. I suggest you to go look at that.
Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 166
Nancy Avent wrote:I am reading OCPJP 7 book by Ganesh/Sharma and I must say that the topic about Inner classes is superbly written. I suggest you to go look at that.

Thanks for your concern Nancy...will go through that book aswell
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner Classes
 
Similar Threads
Native Method
What is a class file with $ symbol in the name
Re:inner classes
Why final keyword is accepted with private?
Most Difficult Part?