
408 CHAPTER 7 Object-Oriented Programming,Part 2: User-Defined Classes
16 if ( compact.equals( sporty ))
17 System.out.println( "\nsporty and compact are equal" );
18 else
19 System.out.println( "\nsporty and compact are not equal" );
20 }
21 }
EXAMPLE 7.11 Auto Client,Version 5
7.11 Static Class Members
As we have mentioned, a separate set of instance variables is created for
each object that is instantiated. In addition to instance variables, classes can
define class variables, which are created only once, when the JVM initial-
izes the class. Thus, class variables exist before any objects are instantiated,
and each class has only one copy of its class ...