Aicloud E-Learning

Guided Notes

Introduction to Java

Classes, the main method, and compiling to the JVM.

Java is a statically-typed, object-oriented language. Every Java program lives inside at least one class, and execution starts in a special method: `public static void main(String[] args)`.

Unlike Python, Java requires you to declare a variable's type: `int age = 36;` not just `age = 36`. The compiler checks types before the program ever runs, catching a category of bugs early.

Java code compiles to bytecode that runs on the JVM (Java Virtual Machine) — the same compiled program can run unmodified on any machine with a compatible JVM installed.