🧠 Java Quiz

Java Introduction

A complete guide to Java — from your first Hello, World! through OOP and collections.

What is Java?

Java is a general-purpose, object-oriented, statically-typed programming language created by James Gosling at Sun Microsystems in 1995 (now owned by Oracle). It was designed around a simple promise: write once, run anywhere. You compile your code to bytecode once, and it runs unchanged on any device with a Java Virtual Machine (JVM).

Java powers a huge slice of the software you use every day:

Why learn Java?

Did you know? Over 3 billion devices run Java. The Mars rovers, the Hubble Space Telescope ground systems, and your favorite banking app all share the same DNA.

Your first Java program

Every Java program starts with a class containing a main method. That method is the entry point — it's what the JVM looks for and runs first.

Example — HelloWorld.java
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Save it as HelloWorld.java, compile with javac HelloWorld.java, then run with java HelloWorld.

What you'll learn

This tutorial walks you from the absolute basics through intermediate Java in roughly the order you'd learn at a good university or bootcamp:

Setup (optional for now)

You don't need to install anything to read this tutorial. When you're ready to write code locally, install the latest JDK (Java Development Kit) from Oracle or use the open-source Eclipse Temurin. Pair it with IntelliJ IDEA Community Edition or VS Code with the Java extension pack.

Ready? Let's start with what actually runs your Java code: the JVM, JDK, and JRE.