Making a class available
The process of loading a class is kicked off by the invocation of the loadClass()
method on a ClassLoader
instance.
Loading a class involves two distinct steps, both of which must be successfully completed before a class can be used.
- Loading the class: In this step, the
findClass()
method of aClassLoader
instance is used to locate the bytecode for this class. The binary form of a class is represented using a well defined class format and typically exists as a.class
file. However, more exotic locations may also be supported. In really mind bending scenarios, the bytecode may even be generated dynamically.Once the bytecode that represents the class has been found, the class is defined using the
defineClass()
method. In ...
Get Tomcat 6 Developer's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.