mattone
dopo mattoneTHE BOOK SERIES
IT/EN
Cover of Java Brick by Brick
← All books

Programming · Java 25 · Draft

Java Brick by Brick

A modern approach to programming

Start with concepts, build a mental model and learn to choose the right solution. A journey through Java programming, one brick at a time.

Explore the contents ↓
PDF · ENGLISH LANGUAGE

The next step: reading.

Java 25 — complete English draft · 404 pages. Draft under review. Editorial and teaching approval remains open.

PDF · 7.5 MB · English

Download the book ↓

Latest release

Text and chapter cross-references reviewed for online reading; license information aligned with the distributed edition.

Creative Commons Attribution–NonCommercial 4.0 (CC BY-NC 4.0)

You may share and adapt the book for non-commercial purposes, crediting the author, linking to the licence and identifying changes. See the full licence terms.

BROWSABLE GUIDE

Read Java online.

The complete guide includes 31 chapters and 8 activity collections, with topic navigation, search and programs to try.

Open the Java guide →
ZIP · JAVA 25 SOURCE CODE

From the book to a running program.

119 Java files organised by chapter, with instructions and a script to compile and run examples separately. Requires JDK 25 and Python 3.10 or later; the chapter 29 project includes Maven tests.

ZIP · 83 KB · English · Version 1.0.0

Download the example project

THE READING JOURNEY

Table of contents

The journey starts with Java concepts and tools, moves on to building programs, and reaches concurrency, resources and quality. The contents follow the current Java 25 draft; the groups below help you navigate the reading.

Foundations and objects

From the introduction to types, objects and error handling.

  • 1. Preface
  • 2. Object-Oriented Programming
  • 3. The Java Language and the Tools for Using It
  • 4. Syntax, Variables, Operators, and Arrays
  • 5. Controlling Program Flow
  • 6. Packages and Modules
  • 7. Defining classes and objects
  • 8. Encapsulation
  • 9. Inheritance, composition and sealed hierarchies
  • 10. Object, wrapper classes and enumerations
  • 11. Strings and Unicode text
  • 12. Exceptions and error handling
Types, functions and data

Interfaces, annotations, generics and tools for processing collections of data.

  • 13. Interfaces, abstract classes and polymorphism
  • 14. Annotations: metadata and checks
  • 15. Generics and Type Checking
  • 16. Functions and Lambdas in Java
  • 17. Choosing a Collection
  • 18. Stream API: Pipelines, Reductions and Gatherers
  • 19. Optional: When a Search Finds Nothing
Concurrency and platform tools

From concurrent work to interaction with files, networks and native functions.

  • 20. Threads and Concurrency in Java
  • 20A. Atomic Operations: One Shared Decision at a Time
  • 21. Java Classloaders: Finding a Class While the Program Runs
  • 23. Further reading: Vector API, processing data in groups
  • 24. Reflection API: observing types at runtime
  • 25. I/O, files and resources: taking data beyond the program
  • 26. Time, localization and exact numbers
  • 27. Networking and HTTP: asking another process for data
  • 28. External memory and native functions: crossing the JVM boundary
Distribution, quality and exercises

Prepare a program for others, check its behaviour and put your learning to the test.

  • 29. From source to a program someone else can run
  • 30. Quality, security and observability: understanding when the program is not enough
  • Activities and Reasoned Solutions C01–C06
  • C07–C12 Activities
  • C13–C18 Activities
  • C19–C24 Activities
  • C20A Activities — Atomic Operations
  • C25–C28 activities: choose, test, transfer
  • Guided activities for C29 and C30
  • Concluding activities: choosing the next brick
  • Conclusions. Keep building, brick by brick

BEFORE YOU START

A question to start with.

How do we move from knowing syntax to reasoning about a program?

The book builds the tools to address this question and recognise the limits of the answers.