Java
61 articles in this topic
Functional Interfaces in Java: SAM Rules, Lambdas and Runnable Examples
Build functional interfaces from zero, replace an anonymous class with a lambda, select standard interfaces by shape, and avoid common compiler traps.
TreeMap and SortedMap in Java: Ordering, Range Views and Worked Examples
Learn how Java's TreeMap orders keys, answers floor and ceiling queries, exposes live range views, and handles comparator collisions through worked examples.
HashSet and TreeSet in Java: Runnable Examples and Key Differences
Learn how Java sets handle duplicates, ordering, navigation and custom objects through deterministic examples you can run and modify.
Java Garbage Collection Tutorial: Reachability, Leaks and Runnable Examples
Trace three connected objects, find exactly when each becomes eligible for collection, and repair a cache that keeps byte arrays reachable.
Java Memory Model Tutorial: Happens-Before, volatile and Safe Publication
Learn the Java Memory Model through exact start/join, volatile, synchronized, final-field and AtomicInteger examples, with clear happens-before guarantees.
Java Exception Handling Tutorial with Runnable Examples
Learn how Java moves control through try, catch, and finally, then build checked custom exceptions and safer file handling with runnable code.
Annotations in Java Tutorial: Custom Metadata, Retention and Reflection Examples
Create a custom Java annotation from zero, inspect its values through reflection, and learn how retention, targets and defaults control the result.
Collections Framework in Java: Interfaces, Implementations, and Examples
Learn how List, Set, Map, and Deque fit together, then choose implementations confidently through one consistent Java example.
JDBC in Java Tutorial: Connections, Queries and Transactions with Examples
Build and run one Java 17 program that creates an H2 table, inserts three products, filters them safely, then rolls back and commits two stock updates.
Inheritance in Java: Learn extends, super, and Overriding with Runnable Examples
Follow one runnable Vehicle and ElectricCar program to see inherited methods, constructor order, super calls, runtime dispatch, common errors, and practice tasks.
Encapsulation in Java: Build Safer Classes with Runnable Examples
Learn how a Java class can protect valid state through private fields, behaviour methods, validation before mutation, and defensive collection copies.
Operators in Java: Types, Precedence and Runnable Examples
Learn how Java evaluates arithmetic, assignment, unary, logical, bitwise and ternary operators through code and step-by-step output traces.













