Loading
According to JVM Specification, the loading phase encompasses finding the .class file by its name and creating its representation in the memory.
The first class to be loaded is the one passed in the command line, with the method main(String[]) in it. We previously described it in Chapter 4, Your First Java Project. The classloader reads the .class file, parses it according to the internal data structure, and populates the method area with static fields and method bytecodes. It also creates an instance of java.lang.Class that describes the class. Then, the classloader links (see section Linking) and initializes (see section Initialization) the class and passes it to the execution engine for running its bytecodes.
In the first project ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access