Core Java Tutorial
Java is a general-purpose, object-oriented programming language used to build everything from Android apps to large enterprise backends. It's known for one big promise: "Write Once, Run Anywhere." Java code compiles to bytecode, which can run on any device with a Java Virtual Machine — Windows, Mac, Linux, or Android — without changes.
Tip: This track covers Core Java from the ground up. Once you're comfortable here, the Spring and Hibernate tracks (coming soon) build directly on these fundamentals.
JDK, JRE, and JVM — What's the Difference?
| Term | What it is | Who needs it |
|---|---|---|
| JVM | Java Virtual Machine — runs compiled Java bytecode on any operating system. | Every Java program, at runtime |
| JRE | Java Runtime Environment — the JVM plus core libraries needed to run Java programs. | Anyone who just wants to run Java apps |
| JDK | Java Development Kit — the JRE plus a compiler and tools needed to write and build Java programs. | Developers (you!) |
How Java Code Runs
[YourFile.java] --compile (javac)--> [YourFile.class bytecode] --run (JVM)--> [Program Output]
You write human-readable code in a .java file. The javac compiler turns it into platform-independent .class bytecode. The JVM on any machine then executes that bytecode — this is what makes Java portable.
Your First Java Program
Example: Hello World
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Breaking it down:
public class HelloWorld— every Java program lives inside a class; the filename must match the class name (HelloWorld.java).public static void main(String[] args)— the entry point. This is always where execution starts.System.out.println(...)— prints text to the console, followed by a new line.
Note: Java is case-sensitive and every statement ends with a semicolon
;. We'll cover syntax rules in depth on the next page.Why Learn Core Java First?
| Reason | What it means for you |
|---|---|
| Strong OOP foundation | Classes, objects, inheritance — concepts every modern language borrows from |
| Huge ecosystem | Android, Spring, Hibernate, and countless enterprise systems run on Java |
| Statically typed | Many mistakes are caught at compile time, before your code ever runs |
| In-demand skill | Consistently one of the most requested languages in backend job postings |
Next steps: Head to Installation & Setup to get the JDK installed and your first program running on your own machine.