Every Java program consists of a collection of classes--nothing else. A class defines a template for creating objects consisting of a set of members which are either fields or methods. A field is a ``container'' that holds a value. A method is a chunk of Java code that defines an operation on the fields of the object containing the method and any values that are passed explicitly as arguments to the method.
Java objects are a generalization of Scheme structs, because the collection of methods that operate on the instances of a class is determined by the class definition. In Scheme, the set of operations for manipulating a struct is fixed (a constructor, a recognizer, field-selectors, and field-modifiers).
In addition to object members, a Java class can define static members that are associated with the class rather than instances of the class. There is only one copy of a static field for an entire class--regardless of how many instances of the class are created (possibly none). The Java code for a static method cannot refer to the dynamic fields of the class because there is no instance associated with such a method. Static fields are really familiar notions from Scheme and C in disguise; static fields behave exactly like ordinary global variables in Scheme or C and static methods behave like ordinary Scheme or C procedures.
Every Java program must contain a root class where execution begins. A root class is distinguished from other classes by the presence of a special method
public static void main(String[] args)
When Java program is run, execution starts at the main method of the root class. Note that when execution begins, no instances of the root class exist. In fact, most Java programs never instantiate the root class because it serves as a shell for organizing program execution rather than a definition of a new form of data. Classes are so flexible that they serve both of these purposes.