Object-Oriented Programming in Java

Notes for the Object-Oriented Programming Courses at Politecnico di Torino

Authors

Marco Torchiano

Stefano Mancini

Published

December 22, 2025

Preface

This books contains a collection of the materials presented during the lectures of the Object-Oriented Programming courses at Politecnico di Torino.

This is not inteded as a complete description of the Java programming language, for that purpose there are severe complete books as well as the official online resources.

The goal of this book is to provide a progressive introduction to the Java language and its main important characteristics.

The course covers three main areas that are reflected into the parts of this book:

  • Software Construction fundamentals: provides a few – language-agnostic – software engineering concepts that represent the basis for a disciplined software construction process. In particular it focuses on the Object-Oriented approach, configuration management, and build management.
  • Java Language definition: describes the basic syntax of the Java language – from foundations such as classes and objects, to inheritance and generic types –
  • Java APIs: introduces the main standard libraries and APIs that are part of the Java ecosystem at large, starting from the collections framework and including the JUnit test framework.

The order of the chapters follows this macro-classification, although for practical reasons the lectures of the course treat the topics in a different order. Considering a 14 weeks semester, a rough subdivision of the topics is:

Week Topic
W1 Object-Oriented Paradigm and Java Environment
W2 Java Basic Features and Basic Git
W3 Java Characters and Strings and JUnit
W4 Inheritance
W5 Generics and Exceptions
W6 Collections framework
W7 GitFlow
W8 Stream API
W9 Java IO and Build management
W10 Object-Relational Mapping
W11 Date and Time
W12 Team project presentation
W13 UML Design
W14 Project review

A more refined outline is reported in the following GANTT diagram:

gantt
    tickInterval 12month
    dateFormat YYYY
    axisFormat %y

    section Software<br>Construction
        1.1 OO:c1, after c4, 6M
        1.2 UML:c1_2, 2013, 6M
        2.1 Basic Git:c21, after c5, 6M
        2.2 GitFlow:c22,2007,6M
        3. Maven:c3, 2009, 6M
    section Java<br>Language
        4.JDK:c4, 2001, 6M
        5.Java:c5, after c4, 12M
        6.String:c6, 2003, 3M
        7.Inheritance: 2003-07, 18M
        8.Exceptions:c8, 2005, 6M
        9.Generics:c9, 2005-07, 6M
    section Java API
        10.Collections:c10, 2006, 1y
        11.Stream:c11, after c22, 18M
        12.JUnit:c12, after c6, 3M
        14.Date:c13, 2011, 6M
        14.IO:c14, 2009-07, 6M
        15.ORM:c15, 2010, 1y
    section Team work
        Project:team, 2012, 3y

License

This website is and will always be free, these contents are licensed under the CC BY-NC 4.0 https://creativecommons.org/licenses/by-nc/4.0/.

You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material

The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms:

  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • NonCommercial — You may not use the material for commercial purposes.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

Colophon

This is a book created from markdown and executable code using Quarto books.

See Knuth (1984) for additional discussion of literate programming that is the general approach of mixing code and text descriptions.