Java is a programming language for building software that runs on many kinds of computers without being rewritten. You write code in readable, English-like syntax, the compiler turns it into bytecode, and the Java Virtual Machine (JVM) runs that bytecode on Windows, macOS or Linux. It is used for web back ends, business systems, Android code and big data tools.
This page explains Java in plain terms: how it works, the ideas behind it, and a few small programs you can run yourself.
Think of Java as a three-step process.
Hello.java.javac) checks it and produces bytecode, a compact instruction set that is not tied to any operating system.Because every platform has its own JVM, the same compiled program runs everywhere. That is the meaning of "write once, run anywhere". The tools to write and compile Java come in the Java Development Kit (JDK), and the tools to only run it come in the Java Runtime Environment (JRE) that is part of the JDK.
Line by line:
public class Hello declares a class, the basic building block of Java code. In older versions the file name must match the public class name.public static void main(String[] args) is the entry point. The JVM starts running here.System.out.println(...) prints a line of text to the console.Run it with java Hello.java on JDK 11 or newer, or compile first with javac Hello.java and then java Hello.
A class is a blueprint, and an object is one thing built from it. A zoo program might have an Animal class, with Dog and Cat extending it.
Java is statically typed: you declare whether something is a whole number, text or true/false, and the compiler stops you from mixing them up by mistake.
You create objects with new, and the garbage collector removes the ones you no longer use. You never free memory by hand, which avoids a large class of crashes common in languages like C.
| Area | Examples |
|---|---|
| Web and APIs | Server applications built with Spring Boot, Quarkus or Jakarta EE |
| Business software | Banking, insurance and order systems |
| Android | Existing apps and libraries; Kotlin is Google's recommended language for new apps |
| Big data | Tools such as Kafka and Spark run on the JVM |
| Desktop and games | Minecraft Java Edition, IDEs like IntelliJ IDEA |
Its syntax is clear and the compiler gives helpful errors, so many people find it a good first language. It is more verbose than Python, but that structure helps when programs grow.
The Java Virtual Machine is the program that runs compiled Java bytecode and manages memory. It is what makes Java portable.
The JDK includes the compiler and developer tools plus the runtime. The JRE is only the runtime for running programs.
No. They are unrelated languages that share part of a name.
Java compiles to bytecode that the JVM runs on any operating system, uses classes and objects to organise code, checks types at compile time and manages memory automatically. Install a current LTS JDK, run a Hello World program, then practise variables, loops and classes with small projects.