You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most languages are one or the other. Java is BOTH — and that's its superpower.
𝗛𝗲𝗿𝗲'𝘀 𝗵𝗼𝘄 𝗶𝘁 𝘄𝗼𝗿𝗸𝘀:
𝗦𝘁𝗲𝗽 𝟭 — 𝗬𝗼𝘂 𝘄𝗿𝗶𝘁𝗲 .𝗷𝗮𝘃𝗮 𝗰𝗼𝗱𝗲
Your human-readable code gets compiled by the Java Compiler (javac) into something called Bytecode (.class files). This isn't machine code yet — it's a middle layer.
𝗦𝘁𝗲𝗽 𝟮 — 𝗝𝗩𝗠 𝘁𝗮𝗸𝗲𝘀 𝗼𝘃𝗲𝗿
The Java Virtual Machine (JVM) reads that bytecode and interprets it line by line. This is why Java is "Write Once, Run Anywhere" — every OS has its own JVM, so the same bytecode runs everywhere.
𝗦𝘁𝗲𝗽 𝟯 — 𝗝𝗜𝗧 𝗖𝗼𝗺𝗽𝗶𝗹𝗲𝗿 𝗸𝗶𝗰𝗸𝘀 𝗶𝗻 🔥
The Just-In-Time (JIT) Compiler watches your code at runtime and identifies frequently executed ("hot") code paths. It compiles those parts directly into native machine code — skipping interpretation entirely for those sections.
Result? Java gets the portability of an interpreter + the speed of a compiler. Best of both worlds.