How Java linker works?

Kirill Dubovikov picture Kirill Dubovikov · Jun 22, 2011 · Viewed 14k times · Source

I want to know how Java linker works. Specifically, in which order it combines classes, interfaces, packages, methods and etc into jvm-executable format. I have found some information here, but there is not so much information about linking order.

Answer

Thorbjørn Ravn Andersen picture Thorbjørn Ravn Andersen · Jun 22, 2011

There is no such thing as a Java "linker". There is, however, the concept of a classloader which - given an array of java byte codes from "somewhere" - can create an internal representation of a Class which can then be used with new etc.

In this scenario interfaces are just special classes. Methods and fields are available when the class has been loaded.