Class variables exist once per class. Class methods operate without reference to a specific object. Instance variables are dynamically created in objects that are instances of classes. Classes support single implementation inheritance, in which the implementation of each class is derived from that of a single superclass, and ultimately from the class Object . Variables of a class type can reference an instance of that class or of any subclass of that class, allowing new types to be used with existing methods, polymorphically.
Classes support concurrent programming with synchronized methods.
Methods declare the checked exceptions that can arise from their execution, which allows compile-time checking to ensure that exceptional conditions are handled. Objects can declare a finalize method that will be invoked before the objects are discarded by the garbage collector, allowing the objects to clean up their state. Although the language does not include parameterized classes, the semantics of arrays are those of a parameterized class with some syntactic sugar. Like the programming language Beta, the Java programming language uses a run-time type check when storing references in arrays to ensure complete type safety. Chapter 9 describes interface types, which declare a set of abstract methods, member types, and constants.