In a JVM, each and every class is loaded by some instance of a java.lang.ClassLoader. The ClassLoader class is located in the java.lang package and developers are free to subclass it to add their own functionality to class loading.
In the Java runtime, each and every class will have its code also
available in the form of a first-class Java object, which is an
instance of java.lang.Class. Whenever we compile any Java file, the
compiler will embed a public, static, final field named class, of the
type java.lang.Class, in the emitted byte code. Since this field is
public, we can access it using dotted notation, like this:
java.lang.Class klass = Myclass.class;
Once a class is loaded into a JVM, the same class (I repeat, the same
class) will not be loaded again Whenever a new JVM is started by
typing java MyMainClass, the "bootstrap class loader" is responsible
for loading key Java classes like java.lang.Object and other runtime
code into memory first. The runtime classes are packaged inside of the
JRE\lib\rt.jar file. We cannot find the details of the bootstrap class
loader in the Java documentation, since this is a native
implementation. For the same reason, the behavior of the bootstrap
class loader will also differ across JVMs.
more about class loading
class loading in short