ZetCode

Java tutorials

Java is a versatile, object-oriented programming language created by Sun Microsystems (now owned by Oracle). Renowned for its platform independence through the "write once, run anywhere" principle enabled by the Java Virtual Machine (JVM), Java is a go-to choice for developing web applications, enterprise software, and mobile apps. Its robustness, scalability, and extensive ecosystem have made it a cornerstone of software development worldwide.

E-books

Java offers a rich set of features, including automatic memory management through garbage collection, multithreading capabilities for concurrent programming, and a comprehensive standard library that simplifies tasks such as data manipulation, networking, and file handling. With its strong emphasis on security and backward compatibility, Java has remained a top choice for building reliable and long-lasting applications across diverse industries.

Widely used in enterprise environments, Java powers some of the world's largest banking, e-commerce, and healthcare systems. It is also integral to Android app development through the Android SDK. With a plethora of frameworks like Spring, Hibernate, and JavaFX, as well as an active developer community, Java continues to thrive as a powerful and adaptable language for modern software development.

Tutorials by topic

The tutorials are grouped by topic. The Java tutorial is a complete introduction to the language; the articles below cover individual topics in depth.

Language basics

The basics of the language: its lexical structure, data types, operators, type conversions, control flow, arrays, methods, and packages, together with newer syntax such as switch expressions, text blocks, and unnamed variables.

Object-oriented programming

Classes, records, interfaces, and sealed hierarchies, object equality and ordering, annotations, and object serialization.

Exceptions

Checked and unchecked exceptions, common runtime exceptions, and automatic resource management with try-with-resources.

Strings and formatting

Creating, joining, splitting, and building strings, regular expressions, and formatting numbers, lists, and locale-specific values.

Collections

Lists, sets, and maps from the collections framework, and common tasks such as filtering, sorting, converting, and iterating over them.

Lambdas and functional interfaces

Lambda expressions, variable capture, and the core functional interfaces of the java.util.function package, together with Optional.

Streams

The Stream API: creating streams and transforming, filtering, sorting, matching, and reducing their elements.

Files and I/O

Working with files and directories through the java.nio.file API, and reading and writing data with streams, readers, and writers.

Date and time

Dates, times, time zones, and Unix time with the java.time API, including formatting and date adjustments.

Concurrency

Threads, futures, atomic variables, the volatile and synchronized keywords, and synchronizers such as semaphores, latches, and barriers.

Utilities

Random numbers, unique identifiers, Base64 encoding, configuration and resource files, and running external processes.

Algorithms

Classic sorting algorithms and other small algorithmic programs implemented in Java.

JSON, XML, and documents

Reading and writing JSON, XML, CSV, Markdown, Excel, and PDF documents.

Databases

Accessing relational and document databases from Java.

Networking and web

HTTP clients, sockets, e-mail, servlets, embedded web servers, web frameworks, template engines, and HTML parsing.

Testing, logging, and libraries

Unit testing, logging, and general-purpose third-party libraries.

GUI, graphics, and games

Desktop GUIs with Swing, 2D graphics, images, charts, games, and Android.

Java lang API

Java io API

Java Regex API

Java DateTime API

Java Collections functions

Java Functional API

last modified November 25, 2026