When we execute any program, at that very moment, JVM performs runtime linking. In other words, it will dynamically load, link, and initialize interface and classes.
- Loading is a process in which it finds the binary representation of a class or interface. And with the help of that binary representation, it creates a class or interface.
- Linking is a process in which it combines a class or an interface into the runtime state of JVM to execute it.
- Initialization is a process in which it executes the initialization method of a class or interface.
When we compile a Java program, it will generate a separate class file for each class or an interface. However, the individual class files may appear to be independent. They are connected and have connections to the Java API’s class files.
At runtime, Java Virtual Machine loads the program’s classes and interfaces and hooks them together. This entire process is known as dynamic linking or runtime linking.