File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static members in 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 "static members in inner classes" Watch "static members in inner classes" New topic
Author

static members in inner classes

Srinivasan Mani
Ranch Hand

Joined: Apr 03, 2002
Posts: 36
Why static members are not allowed inside inner class?
Peter Wu
Greenhorn

Joined: Nov 24, 2002
Posts: 9
An inner class is a nested class that is not explicitly or implicitly declared static. Inner classes may not declare static initializers or member interfaces. Inner classes may not declare static members, unless they are compile-time constant fields.
dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
because the inner class is member variable same as member and class variables.Can you declare static variables in method?


scjp 1.4<br />challenge haven't limit!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: static members in inner classes
 
Similar Threads
Question about static class
static variable in non-static inner class
inner class
inner anonymous class fields initialization
Non-static Inner Class