Java Introduction

Java is a free, general purpose programming language. It was created by James Gosling at Sun Microsystems and was first released in 1995. Today Oracle looks after it, and a big community of companies and developers works on it as open source (OpenJDK).

The famous idea of Java is “write once, run anywhere”. You write your code once, and the same program can run on Windows, macOS and Linux, because Java programs run on the Java Virtual Machine (JVM) and not directly on the operating system.

What can you build with Java?

  • Web back ends and APIs with frameworks like Spring Boot.
  • Android apps (Java and Kotlin are used).
  • Enterprise software for banks, insurance and big companies.
  • Big data and cloud tools (Hadoop, Kafka and many others are written in Java).
  • Desktop apps, games and tools (for example Minecraft Java Edition).

Why do people learn Java?

  • Very popular: in the TIOBE index of November 2026 Java is on the 3rd place, and in the PYPL index (Google tutorial searches) it is on the 2nd place.
  • Strongly typed and safe: the compiler finds many mistakes before the program runs.
  • Object oriented: a good way to learn how big programs are organized.
  • Huge ecosystem: libraries, tools and jobs everywhere.
  • Always improving: a new version comes every 6 months, and a long term support (LTS) version every 2 years.

Java versions

This tutorial is written and tested on Java 25, which is an LTS (long term support) version. Java 27 is the newest release at the time of writing, but it is not an LTS. Almost everything you learn here also works on Java 17 and 21, and we will tell you when something needs a newer version.

You can see the version of the Java on your own computer with one command:

Terminal

$ java -version
openjdk version "25.0.5" 2026-10-20 LTS
OpenJDK Runtime Environment Temurin-25.0.5+8 (build 25.0.5+8-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.5+8 (build 25.0.5+8-LTS, mixed mode, sharing)

A first look

This is a small Java program. Do not worry if you do not understand it yet, we will learn each part in the next chapters.

public class Main {
    public static void main(String[] args) {
        String name = "Java";
        int year = 1995;
        System.out.println("Hello from " + name + "! First released in " + year + ".");
    }
}
Output

Hello from Java! First released in 1995.

What you will learn

  • Install Java and run your first program.
  • Variables, data types, operators and strings.
  • Decisions (if, switch) and loops.
  • Arrays and methods.
  • Classes and objects: constructors, inheritance, interfaces, records and enums.
  • Exceptions, collections (ArrayList, HashMap), generics, lambdas and streams.
  • Dates, files, threads and the new features of modern Java.
Note: All the code outputs in this tutorial come from real runs, so you can type the same code and compare. Next chapter: What is Java? JDK, JRE and JVM.

Congratulations! Chapter Finished. Learn more about the similar topics:
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.