12.1.4
Invoke
Test.main
EXECUTION
12.1.4   Invoke
Test.main
Finally, after completion of the initialization for class
Test
 (during which other
consequential loading, linking, and initializing may have occurred), the method
main
 of
Test
 is invoked.
The method
main
 must be declared
public
,
static
, and
void
. It must accept
a single argument that is an array of strings.
12.2   Loading of Classes and Interfaces
Loading
 refers to the process of finding the binary form of a class or interface type
with a particular name, perhaps by computing it on the fly, but more typically by
retrieving a binary representation previously computed from source code by a
compiler, and constructing, from that binary form, a
Class
 object to represent the
class or interface.
The binary format of a class or interface is normally the
class
 file format
described in
The Java Virtual Machine
, but other formats are possible, provided
they meet the requirements specified in  13.1. The method
defineClass
( 20.14.3) of class
ClassLoader
 may be used to construct
Class
 objects from
binary representations in the
class
 file format.
A Java Virtual Machine system should maintain an internal table of classes
and interfaces that have been loaded for the sake of resolving symbolic references.
Each entry in the table should consist of a fully qualified class name (as a string),
a class loader, and a
Class
 object. Whenever a symbolic reference to a class or
interface is to be resolved, a class loader is identified that is responsible for load 
ing the class or interface, if necessary. The table should be consulted first, how 
ever; if it already contains an entry for that class name and class loader, then the
class object in that entry should be used and no method of the class loader should
be invoked. If the table contains no such entry, then the method
loadClass
( 20.14.2) of the class loader should be invoked, giving it the name of the class or
interface. If and when it returns, the class object that it returns should be used to
make a new entry in the table for that class name and class loader.
The purpose of this internal table is to allow the verification process ( 12.3.1)
to assume, for its purposes, that two classes or interfaces are the same if they have
the same name and the same class loader. This property allows a class to be veri 
fied without loading all the classes and interfaces that it uses, whether actively or
passively. Well behaved class loaders do maintain this property: given the same
name twice, a good class loader should return the same class object each time. But
without the internal table, a malicious class loader could violate this property and
undermine the security of the Java type system. A basic principle of the design of
218






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved