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:
- Backend systems — banking, e-commerce, streaming, payment processing
- Android apps — Java and Kotlin are the primary languages
- Big data — Apache Hadoop, Apache Spark, Kafka are all Java
- Enterprise software — Spring, Jakarta EE, and the bulk of Fortune 500 internal systems
Why learn Java?
- Job market — among the top 3 most-requested languages on every major job board, year after year
- Stable foundations — what you learn today still works in 5 years; the language evolves carefully
- Strong typing catches bugs early — the compiler refuses to run code that does obviously wrong things
- Massive ecosystem — the Java standard library and community packages cover almost every problem domain
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.
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:
- Beginner: JVM/JDK/JRE, syntax, variables, data types, operators, control flow, loops, arrays, methods
- Intermediate: OOP (the four pillars), inheritance, polymorphism, abstraction, encapsulation, exception handling, collections framework
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.