Java Primitives β int, double, boolean and the Eight Built-in Types
The eight Java primitive types explained: int, long, short, byte, double, float, boolean, char. Sizes, ranges, defaults, autoboxing pitfalls, and modern Java idioms.
A structured path through the Java language β from primitives to generics. Modern Java (17/21) idioms, runnable examples, and the common mistakes everyone hits.
The eight Java primitive types explained: int, long, short, byte, double, float, boolean, char. Sizes, ranges, defaults, autoboxing pitfalls, and modern Java idioms.
The four kinds of Java variable: local, instance, static and parameter. Scope, defaults, final, var (Java 10+), and the modern idioms that make codeβ¦
Every Java control-flow construct: if/else, switch (classic and expression form), for, enhanced-for, while, do-while, break, continue, labelled loops. Modern Java pattern matching.
Java OOP from the ground up: classes, objects, constructors, inheritance, polymorphism, abstraction, encapsulation. Modern Java records, sealed classes and interfaces with default methods.
Java methods explained: signature, parameters (including varargs), return types, overloading, static vs instance, recursion, the difference with constructors, and lambdas.
The Java Collections Framework explained: List (ArrayList, LinkedList), Set (HashSet, TreeSet), Map (HashMap, LinkedHashMap), Queue, Deque. Performance, when to use each, modern factory methods.
The four Java access modifiers (public, private, protected, package-private) explained with a visibility table, real-world examples and the modern module system considerations.
Java exception handling: the hierarchy (Throwable, Error, RuntimeException), try-catch-finally, try-with-resources, checked vs unchecked, custom exceptions, and the most common runtime errors.
Full list of Java reserved words and keywords: abstract, boolean, break, case, class, final, instanceof, new, static, switch, synchronized, this, throw, var, yield, sealed,β¦
Every Java operator by category with precedence and associativity: arithmetic, comparison, logical, bitwise, assignment, ternary, instanceof. Modern pattern matching and the string concatenation trap.
Java annotations explained: built-in (@Override, @Deprecated, @SuppressWarnings, @FunctionalInterface), how to write a custom annotation with retention and target, and common framework uses (Spring, JPA,β¦
Java generics from scratch: type parameters, wildcards (? extends, ? super), bounded types, type erasure, raw types. The PECS rule and why generics disappearβ¦
Each pillar page covers a core area of the Java language end-to-end β what it is, how it works, modern idioms (record, var, sealed classes, pattern matching), and the common mistakes. Each pillar links down to spoke pages that go deep on a single concept (one keyword, one collection, one exception type).
Read in this order: Primitives β Variables β Control flow β Methods β OOP β Collections β Exceptions.
Use the search bar in the header, or jump straight to the relevant pillar above. Spoke pages are linked from the pillar's table of contents.
Examples target Java 17 (LTS) and Java 21 (LTS). Where a feature is newer, the Java version requirement is called out. Where the legacy approach is still common in the wild (e.g. SimpleDateFormat, raw HashMap, anonymous inner classes), it is shown alongside the modern idiom so you can read both old and new code.
Most snippets are runnable in the Java Online Compiler without setup. When a snippet uses an external library (Jackson, Lombok, JJWT), it's flagged.