Guide · Java Programming Language

Java Programming Language – Learning Guide

Java is an object-oriented language that runs on any computer with the Java platform installed. It is used for desktop and Android applications, server programs and in teaching programming.

The guide leads from the basics of the language, through classes, objects and collections, to web applications in Spring Boot, graphical applications and physics simulations.

  • Secondary school
  • Beginner and intermediate level
  • Examples in Java
Tip: Java is easiest to learn in IntelliJ IDEA Community, NetBeans or VS Code (with the Java extension). Run every example and change at least one value.

Some lessons linked below are available only in Serbian for now. They are marked (SR).

1 Java basics

The first program, variables, operators, branching, loops, arrays, strings and methods.

2 Object-oriented programming

Classes and objects are the basis of Java. This part is the most important for further learning.

3 Collections and lambda expressions

Data structures from the Java standard library and processing data with streams.

4 Spring Boot: web applications in Java

Java on the server: REST API, a database and publishing on the internet. You need classes, collections and web basics.

5 Graphical applications (GUI)

Windows, buttons, drawing and animations.

6 Physics simulations

Using Java to model physical phenomena.

7 Solved tasks in Java

Tasks on the basics and on object-oriented programming.

✎ A short example

The Circle class with a method for the area, and how it is used.

class Circle {
    double r; // radius

    Circle(double r) {
        this.r = r;
    }

    // area of the circle: r * r * pi
    double area() {
        return Math.PI * r * r;
    }
}

public class Main {
    public static void main(String[] args) {
        Circle c = new Circle(3);
        System.out.println("Area: " + c.area());
    }
}