DevNotes
Support
Java · 13 chapters

Core Java

OOP, SOLID, Object class, equality, Strings, immutability, wrappers, enums, records, sealed classes, var and pass-by-value.

CHAPTER 01

OOP Principles

Classes, objects and the four pillars: encapsulation, inheritance, polymorphism and abstraction.

6 min · 16 Q&A · 16 examples
CHAPTER 02

SOLID Principles

Five object-oriented design principles for clean, maintainable, loosely coupled code.

6 min · 12 Q&A · 10 examples
CHAPTER 03

Object Class

The root of every Java class: toString, equals, hashCode, clone, getClass, wait/notify and finalize.

6 min · 10 Q&A · 16 examples
CHAPTER 04

equals() and hashCode()

Logical equality, the hashCode contract and how HashMap and HashSet use both methods internally.

6 min · 8 Q&A · 13 examples
CHAPTER 05

== vs equals()

Reference comparison vs logical equality, with String pool, wrapper caching, enum and null-check cases.

6 min · 8 Q&A · 24 examples
CHAPTER 06

String, StringBuilder & StringBuffer

Immutability, the String Constant Pool, mutable builders, capacity growth and choosing the right class.

6 min · 10 Q&A · 18 examples
CHAPTER 07

Immutable Objects

What immutability means, why Java relies on it, and the rules for building truly immutable classes.

6 min · 10 Q&A · 21 examples
CHAPTER 08

Wrapper Classes & Autoboxing

Object versions of primitives, autoboxing and unboxing, Integer caching and the null-unboxing trap.

6 min · 10 Q&A · 26 examples
CHAPTER 09

Enums

Type-safe constants with fields, constructors and behaviour, plus EnumSet, EnumMap and JPA persistence.

6 min · 10 Q&A · 30 examples
CHAPTER 10

Records (Java 16+)

Compact, immutable data carriers with generated constructors, accessors, equals, hashCode and toString.

6 min · 10 Q&A · 25 examples
CHAPTER 11

Sealed Classes (Java 17+)

Controlled inheritance with permits, final, sealed and non-sealed, and how it pairs with pattern matching.

5 min · 10 Q&A · 17 examples
CHAPTER 12

var Keyword (Java 10+)

Local variable type inference: what the compiler infers, where var is allowed and where it is not.

6 min · 11 Q&A · 32 examples
CHAPTER 13

Pass by Value in Java

Why Java is always pass-by-value, and what really happens when you pass primitives, objects, Strings and arrays.

6 min · 11 Q&A · 20 examples