Home Segments Top Top Previous Next

831: Mainline

Whenever the Java virtual machine loads a class or interface, it creates for that class or interface a companion instance of a special class called, confusingly enough, Class. Instances of the Class class generally provide access to useful information about their companion class, such as, for example, the companion class's name and the names of its instance variables.

The companion Class instance also provides access to methods that are capable of locating resources, such as text and image files.