12.Execution:
The Java Virtual Machine starts execution by invoking the method main of some
specified class, passing it a single argument, which is an array of strings
1 Load the Class.
The loading process is implemented by the class ClassLoader and its subclasses.
Different subclasses of ClassLoader may implement different loading policies. In
particular, a class loader may cache binary representations of classes and interfaces,
prefetch them based on expected usage, or load a group of related classes together.
If an error occurs during class loading, then an instance of one of the following
subclasses of class LinkageError will be thrown at any point in the program that
(directly or indirectly) uses the type:
• ClassCircularityError: A class or interface could not be loaded because it
would be its own superclass or superinterface (§8.1.4, §9.1.3, §13.4.4).
• ClassFormatError: The binary data that purports to specify a requested
compiled class or interface is malformed.
• NoClassDefFoundError: No definition for a requested class or interface could
be found by the relevant class loader.
12.3 Linking of Classes and Interfaces EXECUTION
320
Because loading involves the allocation of new data structures, it may fail with an
OutOfMemoryError.
2.Link Test: Verify, Prepare, (Optionally) Resolve
Verification checks that the loaded representation of Test is well-formed, with a
proper symbol table.
Preparation involves allocation of static storage and any data structures that are
used internally by the implementation of the Java Virtual Machine, such as method
tables.[url]http://en.wikipedia.org/wiki/Symbol_table[/url]
Preparation involves creating the static fields (class variables and constants) for a class or interface and initializing such fields to the default values
does not require the execution of any source code; explicit initializers for static fields are executed as part of initialization (§12.4), not preparation.
Resolution is the process of checking symbolic references with other
classes and interfaces, by loading the other classes and interfaces that are mentioned
and checking that the references are correct.
errors in Resolution step: IncompatibleClassChangeError,IllegalAccessError,InstantiationError,NoSuchFieldError,NoSuchMethodError, UnsatisfiedLinkError.
3. Initialization of Classes and Interfaces
Initialization consists of execution of any class variable initializers and static
initializers of the class
4.Creation of New Class Instances
The Java Virtual Machine starts execution by invoking the method main of some
specified class, passing it a single argument, which is an array of strings
1 Load the Class.
The loading process is implemented by the class ClassLoader and its subclasses.
Different subclasses of ClassLoader may implement different loading policies. In
particular, a class loader may cache binary representations of classes and interfaces,
prefetch them based on expected usage, or load a group of related classes together.
If an error occurs during class loading, then an instance of one of the following
subclasses of class LinkageError will be thrown at any point in the program that
(directly or indirectly) uses the type:
• ClassCircularityError: A class or interface could not be loaded because it
would be its own superclass or superinterface (§8.1.4, §9.1.3, §13.4.4).
• ClassFormatError: The binary data that purports to specify a requested
compiled class or interface is malformed.
• NoClassDefFoundError: No definition for a requested class or interface could
be found by the relevant class loader.
12.3 Linking of Classes and Interfaces EXECUTION
320
Because loading involves the allocation of new data structures, it may fail with an
OutOfMemoryError.
2.Link Test: Verify, Prepare, (Optionally) Resolve
Verification checks that the loaded representation of Test is well-formed, with a
proper symbol table.
Preparation involves allocation of static storage and any data structures that are
used internally by the implementation of the Java Virtual Machine, such as method
tables.[url]http://en.wikipedia.org/wiki/Symbol_table[/url]
Preparation involves creating the static fields (class variables and constants) for a class or interface and initializing such fields to the default values
does not require the execution of any source code; explicit initializers for static fields are executed as part of initialization (§12.4), not preparation.
Resolution is the process of checking symbolic references with other
classes and interfaces, by loading the other classes and interfaces that are mentioned
and checking that the references are correct.
errors in Resolution step: IncompatibleClassChangeError,IllegalAccessError,InstantiationError,NoSuchFieldError,NoSuchMethodError, UnsatisfiedLinkError.
3. Initialization of Classes and Interfaces
Initialization consists of execution of any class variable initializers and static
initializers of the class
4.Creation of New Class Instances