JAVA + SPRING BOOT · 26 lessons
Basics → OOP → Collections → Modern Java → Spring Boot + JPA
26-lesson track: basics, OOP, collections/generics, exceptions/IO, modern Java, and Spring Boot through JPA. Each lesson includes the full tutorial, runnable example code (`src/*.java`), a homework task and a reference solution.
Part 1: Basics
5 lessons
Getting Started with Java
Java is a static type/object-oriented programming language that has been used as a main language in the industrial field for 30 years since its announcement in 1995…
Variables and Types
A variable is a “labeled box” that holds data. Java is a static type language, so you must decide in advance what type of value each variable will contain at the time…
Operators and Expressions
An operator is a symbol that takes a value (operand) and creates a new value. Java's operators look familiar because they originated from C/C++, but they have…
Control Flow
The statement used to split or repeat the flow of code is a control flow. Java's control statements resemble C's, but modern forms such as switch expression in JDK…
Methods
A method is “a bunch of code with a name”. When you need to do the same thing multiple times, separating it into methods improves readability and reusability at the…
Part 2: Object-Oriented Programming
5 lessons
Classes and Objects
Java is an object-oriented (OOP) language. Data is defined as a class, and an object (instance) is taken from the blueprint and used. In this section, you will see…
Encapsulation
Encapsulation is an OOP principle that hides the state (field) of an object from the outside and makes it accessible only through designated methods (getter/setter…
Inheritance
Inheritance is an OOP mechanism that defines a new class by inheriting the fields and methods of an existing class. Common operations determined by the parent (super)…
Polymorphism
Polymorphism is the core of OOP, allowing the same message (method call) to perform different actions depending on the type of object. Various child objects are…
Interfaces
An interface is a contract that only determines “what a class can do.” Java classes can only inherit from one parent, but multiple interfaces (implements) can be…
Part 3: Collections & Generics
4 lessons
Arrays
Array is the most basic data structure that accesses values of the same type using consecutive indices. Once the size is set, it cannot be changed (fixed size), but…
List, Set, Map
Arrays have a fixed size, but in practice, Add/delete free collection is more often used. The three most used ones are List, Set, and Map
Generics
Generics are a mechanism that defers "which type to deal with" to the time of defining class/method. The brackets in List are the placeholders. It is safe because the…
Stream API
The Stream API is a tool for declaratively transforming, filtering, and aggregating collections. It changes the for loop + temporary variable code into a one-line…
Part 4: Exceptions & I/O
3 lessons
Exception Handling
try / catch / finally, Checked vs Unchecked, throws
File I/O
Reading and writing files is a function that almost every program needs. Focusing on Files and Path of Java's new IO API, java.nio.file, you will learn the…
String Handling
String (String) is a data type that is indispensable in any program. Java's String is immutable, and in cases where changes are frequent, StringBuilder is used…
Part 5: Modern Java
5 lessons
Lambdas and Functional Interfaces
Lambda is a short form of anonymous function. This is a core grammar that can be found almost everywhere since JDK 8, including collections, streams, and spring. Also…
Optional
Optional is a container that specifies "may or may not have a value" as type. When used in methods where the return value can be null, it forces the caller to never…
Date and Time
The standard API that handles date and time has been extensively reorganized with the java.time package starting from JDK 8. Equipped with immutable objects, clear…
Maven and Gradle
So far, we have treated one or two .java files directly as javac / java. In practice, build tools automate dependencies, compilation, testing, and deployment. The two…
JUnit Testing
To say that code "works" it needs to be verified. JUnit 5 is Java's de facto standard testing framework, providing a short and clear annotation-based API
Part 6: Spring Boot
4 lessons
Getting Started with Spring Boot
Spring Boot is a framework that creates ready-to-run web applications without dozens of lines of XML with a “convention over configuration” philosophy. The server…
REST Controllers
REST API is a promise to handle resources using only HTTP methods (GET / POST / PUT / DELETE) and URLs. In Spring Boot, it can be implemented very concisely with…
Services and Layers
For small examples, it's okay to have all the logic in one controller class, but as things get bigger, separation of layers becomes critical to maintainability. Learn…
Data Persistence with JPA
So far, data has only been handled with the in-memory Map. Now we use Spring Data JPA and H2 In-Memory DB to create a persistence layer that behaves the same across…