Java Execution Flow: Compiler, JVM & JDK Explained

📘 Day 3: Understanding Compiler, JVM & Java Execution – In Detail Today I connected the full Java execution flow, not just definitions — from source code to output. 🔹 Role of Compiler (javac) The compiler checks: ✔ Syntax correctness ✔ Class, method, interface declarations ✔ Data types & variables ✔ Converts .java → bytecode (.class) ✔ Ignores comments 🔹 What happens during Execution? 1️⃣ Bytecode is loaded into JVM 2️⃣ Class Loader loads classes 3️⃣ Memory Allocation happens Method Area → class & static info Heap → objects & arrays Stack → local variables & method calls PC Register → current instruction Native Method Area 4️⃣ Execution Engine runs the code Interpreter executes line by line JIT Compiler optimizes repeated code 5️⃣ Output is produced 🎯 🔹 What is JVM? JVM is an Application / Process-based Virtual Machine that executes Java bytecode and makes Java platform-independent. 🔹 JDK vs JRE (Crystal Clear) ✅ JDK = JRE + Development Tools (javac, java, javadoc, javap) ✅ JRE = JVM + Java Libraries + Runtime support ❌ JRE does NOT contain compiler 🔹 Why JIT Compiler is Important? It converts frequently used bytecode into native machine code → faster execution ⚡ This session helped me understand why Java is secure, portable, and efficient, not just memorize terms. Consistent learning > Rote learning. Day 3 completed 🚀 #Java #Compiler #JVM #JDK #JRE #CoreJava #MCA #LearningJourney #ComputerScience #InterviewPrep

  • text, letter

To view or add a comment, sign in

Explore content categories