← Java Programming learning path
Java Programming · Module 1 of 10

Java basics

Java is an object-oriented language that runs anywhere a JVM is installed.

📖 Key ideas

  1. Java code is compiled to bytecode (.class) and run by the Java Virtual Machine (JVM).
  2. "Write once, run anywhere": the same bytecode runs on Windows, Linux and macOS.
  3. A program starts at public static void main(String[] args).
  4. System.out.println("Hi"); prints a line.
  5. JDK = tools to build; JRE/JVM = runtime to run.
💡 Real-life example: The JVM is like a universal plug adapter: the same Java program plugs into any operating system.
JVMRuns Java bytecode
JDKKit with the compiler and tools
BytecodeCompiled .class instructions
mainEntry point of a Java program