← Back to Core Java Course | Chapter 1: Introduction & Basics | Lesson 2 of 12

Java History & Features

History of Java

James Gosling led the team that created Java at Sun Microsystems, first releasing it in 1995 under the name Oak before renaming it Java -- the goal from the start was a simpler, safer alternative to C++.

Example: History of Java

java
public class Main {
	public static void main(String[] args) {
		String originalName = "Oak";
		String releaseYear = "1995";
		System.out.println("Java was created by James Gosling at Sun Microsystems in " + releaseYear + ", originally named " + originalName + ".");
	}
}

Platform Independence

Because the compiler targets bytecode instead of a specific CPU's machine code, the exact same compiled program runs unmodified on any operating system that has a JVM installed.

Example: Platform Independence

java
public class Main {
	public static void main(String[] args) {
		// This same Main.class file runs unmodified on Windows, Linux, and macOS
		System.out.println("Compiled once, runs on any OS with a JVM installed.");
	}
}

Object-Oriented Programming

Java forces you to model your program as classes and objects from the ground up, which encourages breaking large problems into smaller, testable, reusable pieces rather than one long procedural script.

Example: Object-Oriented Programming

java
class Task {
	String name;
	Task(String name) { this.name = name; }
	void run() { System.out.println("Running: " + name); }
}
public class Main {
	public static void main(String[] args) {
		Task task = new Task("Send Email");
		task.run();
	}
}

Robustness and Security

The JVM validates bytecode before running it, enforces array bounds checking, and gives you no raw pointers to corrupt memory with -- trade-offs that sacrifice some raw speed for far fewer crash-causing bugs.

Example: Robustness and Security

java
public class Main {
	public static void main(String[] args) {
		int[] numbers = {1, 2, 3};
		try {
			System.out.println(numbers[5]); // out-of-bounds access
		} catch (ArrayIndexOutOfBoundsException e) {
			System.out.println("Caught by JVM bounds checking: " + e.getMessage());
		}
	}
}

Multi-threading Support

Since threads are a first-class part of the language (via the Thread class and java.util.concurrent), you can genuinely run independent tasks in parallel to keep a CPU-bound or I/O-bound program responsive.

Example: Multi-threading Support

java
public class Main {
	public static void main(String[] args) throws InterruptedException {
		Thread worker = new Thread(() -> System.out.println("Running independently on its own thread"));
		worker.start();
		worker.join();
	}
}

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.