February 2014
Beginner
1248 pages
62h 25m
English
• A static variable (p. 338) represents classwide information that’s shared among the class’s objects.
• static variables have class scope. A class’s public static members can be accessed through a reference to any object of the class, or they can be accessed by qualifying the member name with the class name and a dot (.). Client code can access a class’s private static class members only through methods of the class.
• static class members exist as soon as the class is loaded into memory.
• A method declared static cannot access a class’s instance variables and instance methods, be cause a static method can be called even when no objects of the class have been instantiated.
• The this reference cannot be used ...
Read now
Unlock full access