This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
you mean package member classes... because top-level (nested) classes are always static... Static means that no instance of the enclosing class is needed to instantiate the enclosed class. [ October 11, 2002: Message edited by: Valentin Crettaz ]
You are perfectly write my question was of regarding package member class. We know that ,if method or variable is static that means it can be accessed without any referance of class.Moreover static variable belong to whole class etc But what are the possible reasons for a entire class to be non-static. In short my question is "Why java does not allow to declare top level menber class as static?"
Joined: Aug 26, 2001
It would be a good idea if you could read the following chapter of Mughal's book: Chapter 7: Inner classes The topic is very well explained there