Java Zero to All All questionsPractise free
Interview questions › Interview Rapid-Fire — Top Q&A › JVM Internals — Top Interview Q&A

Explain the Class Loading lifecycle.

Level III · MidJVM Internals — Top Interview Q&A
Short answer

Three phases: Loading (a classloader reads the bytecode and creates the Class object), Linking, and Initialization.

Explanation

Linking splits into Verification (bytecode is type-safe and well-formed), Preparation (static fields allocated and set to default zero values), and Resolution (symbolic references resolved to direct references, may be lazy). Initialization runs static initializers and static-field assignments in <clinit>, triggered on first active use and guaranteed to run exactly once per class in a thread-safe way.

Common mistakes
  • Mixing up loading, linking and initialization.
  • Forgetting the verification step.

Can you say this out loud in two minutes? Drill it in a timed mock interview, with flashcards and runnable code for JVM Internals — Top Interview Q&A.

Practise free

More on JVM Internals — Top Interview Q&A