Java works with class loaders . Classes are needed for compilation, as it will perform a static type check to make sure that you use the correct signatures for each method.
However, after compiling them, they are not connected, as you have, in the C / C ++ compiler, so each .class file is autonomous. Of course, this means that you will have to provide the compiled classes used by your program when you intend to execute it. So this is a little different than the way C and C ++ prepare executables. You actually do not have a binding phase, this is not necessary.
the classloader will dynamically load them, adding them to the runtime database used by the JVM.
In fact, there are many class loaders that are used by the JVM that have different permissions and properties, you can also explicitly call it to ask to load the class. What happens can also be a kind of βlazyβ loading, in which the compiled .class code is loaded only if necessary (and this loading process can raise a ClassNotFoundException if the specified class is not inside the class path)
source share