0% found this document useful (0 votes)
3 views1 page

Java Interview Cheat Sheet

This Java interview cheat sheet provides a concise overview of key concepts including the definitions of JDK, JRE, and JVM, as well as the compilation and execution process. It outlines the JVM memory model, garbage collection, and the execution engine, highlighting important functionalities like the Class Loader and Java Class Library. Additionally, it includes impactful one-liners that summarize critical aspects of Java's architecture and behavior.

Uploaded by

Chinna Vmr
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java Interview Cheat Sheet

This Java interview cheat sheet provides a concise overview of key concepts including the definitions of JDK, JRE, and JVM, as well as the compilation and execution process. It outlines the JVM memory model, garbage collection, and the execution engine, highlighting important functionalities like the Class Loader and Java Class Library. Additionally, it includes impactful one-liners that summarize critical aspects of Java's architecture and behavior.

Uploaded by

Chinna Vmr
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Interview Cheat Sheet (1 Page)

1) Java in One Line


Java is a high-level, object-oriented, platform-independent language used for desktop, web, mobile, and enterprise apps.
2) JDK, JRE, JVM
• JDK = JRE + dev tools (javac, java, javadoc, debugger).
• JRE = JVM + standard libraries to run apps (from Java 11, bundled within JDK).
• JVM executes bytecode → native machine code (JVM is platform dependent; bytecode is platform independent). 3)
Compilation → Execution
• Compilation (javac): .java → .class (bytecode); syntax + semantic checks.
• Execution (JRE/JVM): Class Loader → Bytecode Verifier → Memory → Execution Engine (Interpreter + JIT). 4) Class
Loader
Parent Delegation Model.
• Bootstrap → core classes (java.*).
• Platform/Extension → lib/ext or modules.
• Application → classpath classes. 5) JVM Memory Model
• Method Area / Metaspace: class metadata, method code, static vars, constant pool.
• Heap: all objects (GC runs here).
• Stack: per-thread frames, local vars, references.
• PC Register: current instruction per thread.
• Native Method Stack: JNI calls (C/C++). 6) Garbage Collection (GC)
• GC is a process on the Heap, not a memory area.
• Objects become eligible when unreachable; [Link]() is only a hint.
• Runs automatically based on memory pressure/heuristics. 7) Execution Engine
• Interpreter: line-by-line, quick startup.
• JIT: compiles hot code to optimized native; boosts performance. 8) Java Class Library (JCL)
Core APIs ([Link], [Link], [Link], ...). Comes with JRE (hence with JDK). Enables portability & productivity. 9)
High-Impact One-Liners
• "Bytecode is platform independent; JVM is platform dependent."
• "ClassLoader loads classes; Metaspace stores metadata; Heap stores objects; Stack stores frames."
• "GC runs on the Heap when the JVM decides—not immediately after null/new."
• "Interpreter starts fast; JIT optimizes hot paths."
• ".class is like a DVD; JVM is the player for each OS/CPU."

© Cheat Sheet – Prepared for interview quick recall

You might also like