
Java
154 Posts Available
Complete Java Learning Guide (151 chapters)
Start with the series index for the full chapter list. The complete 151-chapter guide is published—from core Java through Spring Boot, advanced JVM topics, security, production practices, and a closing roadmap—so you can follow the path end to end or jump back to any chapter when your work needs it.
Why Java belongs in your backend toolkit
Java has been shipping production systems for decades. Banks, telecoms, e-commerce platforms, and cloud-native companies still choose it when they want mature libraries, predictable performance tuning on the JVM, and a hiring market that understands how to operate large services.
This section of the blog focuses on the skills that move you from syntax exercises to maintainable applications: object-oriented design, the collections framework, modern Java features, JDBC, HTTP APIs, and Spring Boot—the stack you are most likely to see in real jobs.
What you will build toward
Strong core language skills
Types, OOP, exceptions, collections, and modern Java features are the foundation. The roadmap post ties these topics to how they show up in real services—not only in exam-style snippets.
APIs, data, and Spring Boot
JDBC, REST design, validation, layered architecture, and sensible error handling are what teams review in interviews and in code review. The guide walks those ideas with concrete examples.
Production habits
Logging, configuration, security basics, testing, and deployment topics are easy to skip while learning—until they are not. The roadmap ends with what changes when code leaves your laptop.
How to use these tutorials
Follow the numbered chapters in order on your first pass. Keep one small project folder, type examples by hand, and read compiler messages slowly—they are part of the curriculum.

Complete Java Learning Guide: Beginner to Advanced — Series Index
Master index for the complete 151-chapter Java learning series: introduction, basics, control flow, OOP, collections, Java 8+, JDBC, Spring Boot, advanced JVM, security, production—all chapters linked from this page.

Chapter 1: What is Java? — Complete Java Learning Guide
Learn what Java is in plain language, where it runs in the real world, and why teams still choose it for backends, Android, banking, and APIs.

Chapter 2: How Java Works — JVM, JRE, JDK, and Bytecode
Understand the JVM, JRE, and JDK, how Java source compiles to bytecode, and what Write Once Run Anywhere really means—with a simple compile-and-run walkthrough.

Chapter 3: Java Setup — Install JDK and Choose an IDE
Install a Java JDK on Windows, macOS, or Linux, verify it with java and javac, and pick an IDE—IntelliJ, Eclipse, or VS Code—with sane defaults for beginners.

Chapter 4: First Java Program — class, main, println, how it runs
Write your first Java program: public class, the main method, System.out.println, and what the JVM does step by step when you hit run.

Chapter 5: Variables in Java — Declaration, Initialization, and Naming
Learn Java variables in depth: what they are, how to declare and initialize them, naming rules and conventions, scope basics, and mistakes beginners make.

Chapter 6: Data Types in Java — Primitives, String, Array, and Objects
Master Java data types: every primitive from byte to boolean, String and arrays as non-primitive types, defaults, ranges, and the difference between primitives and references.

Chapter 7: Operators in Java — Arithmetic, Logic, Assignment, and More
Learn Java operators in depth: arithmetic, assignment, comparison, logical, increment and decrement, ternary, and a gentle intro to bitwise operators—with examples and pitfalls.

Chapter 8: Type Casting in Java — Widening, Narrowing, and Data Loss
Learn type casting in Java: implicit widening, explicit narrowing casts, char and int promotion rules, common data-loss bugs, and safe habits with literals.

Chapter 9: User Input in Java — Scanner, Numbers, Strings, and nextLine Pitfalls
Read keyboard input in Java with Scanner: strings, ints, doubles, the nextInt-then-nextLine gotcha, locale issues, and when to stop using Scanner in real apps.

Chapter 10: if Statement in Java — Conditions and Single-Branch Decisions
Learn the Java if statement only: boolean conditions, braces, when the body runs, common bugs with assignment vs comparison, and small real-world examples.

Chapter 11: if-else Statement in Java — Two-Way Branching
Learn Java if-else only: two branches, mutually exclusive paths, style with braces, and patterns like validation without cramming other control flow topics.

Chapter 12: else-if Ladder in Java — Many Ordered Conditions
Learn the else-if ladder in Java: ordered mutually exclusive branches, comparing to stacked ifs, fall-through risks, and grade or discount style examples.

Chapter 13: Nested if in Java — Conditions Inside Conditions
Learn nested if statements in Java: when to nest, how braces bind else, flattening with guards, readability limits, and login-style examples without mixing in switch.

Chapter 14: switch Statement in Java — Classic and Modern switch Expressions
Learn Java switch alone: classic switch with break, fall-through risks, String and enum cases, and modern switch expressions with yield and arrows (Java 14+).

Chapter 15: for Loop in Java — Indexed Loops and the Enhanced for
Learn the Java for loop in depth: init, condition, update, scope of loop variable, nested for, and the enhanced for-each form—with examples and off-by-one pitfalls.

Chapter 16: while Loop in Java — Condition-First Repetition
Learn the Java while loop only: condition checked before each iteration, zero or more runs, update inside the body, and infinite-loop pitfalls compared to for.

Chapter 17: do-while Loop in Java — Body First, Then Condition
Learn the Java do-while loop only: body runs at least once, trailing while condition, menu-style examples, and when do-while beats while.

Chapter 18: break Statement in Java — Exit Loops and switch Early
Learn Java break alone: leaving for/while/do-while early, break in switch, labeled break to exit outer loops, and when break hurts readability.

Chapter 19: continue Statement in Java — Skip to the Next Iteration
Learn Java continue alone: skipping the rest of a loop body, behavior in for vs while, labeled continue, and common confusion with break.

Chapter 20: Arrays in Java — What They Are, How They Live in Memory, and First Steps
Learn what Java arrays are: fixed-size containers, reference types, default element values, length field, indexing and bounds, and how arrays differ from a pile of separate variables.

Chapter 21: One-Dimensional Array in Java — Patterns, Copying, and Common Algorithms
Master one-dimensional Java arrays: filling and scanning, min/max, sum and average, swapping, copying with Arrays.copyOf, anonymous arrays, and typical exam-style loops.

Chapter 22: Two-Dimensional Array in Java — Matrices and Jagged Arrays
Learn 2D Java arrays: rows and columns, rectangular matrices, jagged arrays where row lengths differ, nested loops, and common indexing mistakes.

Chapter 23: String in Java — Immutability, Literals, and Reference Behavior
Learn Java String as a type: immutability, string literals, concatenation, == vs equals, null safety, and why String is not a primitive—without dumping every method here (Chapter 24).

Chapter 24: String Methods in Java — Searching, Slicing, Cleaning, and Comparing
Tour essential Java String methods: length, charAt, substring, indexOf, contains, equals, equalsIgnoreCase, trim, split, replace, toLowerCase, isEmpty, and isBlank—with pitfalls.

Chapter 25: StringBuilder in Java — Mutable Text Buffers and Efficient Append
Learn Java StringBuilder: append, insert, delete, reverse, internal capacity, toString, why it is not thread-safe, and when to use it instead of String concatenation.

Chapter 26: StringBuffer in Java — Synchronized Mutable Buffers and Legacy APIs
Learn Java StringBuffer: same operations as StringBuilder but synchronized, when that matters, performance cost, and where you still see it in older code.

Chapter 27: String vs StringBuilder vs StringBuffer in Java — When to Use Which
Compare Java String, StringBuilder, and StringBuffer: immutability, mutability, threading, performance patterns, and decision rules for real code—not memorized slogans.

Chapter 28: Methods in Java — What They Are, How to Declare Them, and How to Call Them
Learn Java methods from scratch: why they exist, declaration parts (name, parameters, return type preview), void methods, calling from main, and organizing main to stay thin.

Chapter 29: Method Parameters in Java — Pass-by-Value, Order, and References
Learn Java method parameters in depth: pass-by-value semantics, primitives vs references, final parameters, arity and order rules, and common misconceptions about swapping.

Chapter 30: Return Type in Java — void, Primitives, References, and Early return
Learn Java return types: void vs values, return statement rules, unreachable code, returning references, and early-return style for readable methods.

Chapter 31: Method Overloading in Java — Same Name, Different Parameter Lists
Learn Java method overloading: rules the compiler uses, overload vs override, autoboxing pitfalls, and why return type alone cannot distinguish overloads.

Chapter 32: Recursion in Java — Base Case, Call Stack, and When to Stop
Learn recursion in Java: base case and recursive step, stack overflow risk, factorial and fibonacci with warnings, and converting simple recursion to loops.

Chapter 33: Class and Object in Java — Blueprint, Instance, and new
Learn Java class and object fundamentals: fields, methods, instantiation with new, reference variables, dot notation, and a first tiny domain model without inheritance yet.

Chapter 34: Constructor in Java — Object Initialization and Overloading Constructors
Learn Java constructors: default vs explicit, parameter lists, this() chaining, initialization order, and common mistakes with return types and names.

Chapter 35: this Keyword in Java — Instance Context, Fields, and Constructor Chains
Learn the Java this keyword: referring to the current object, disambiguating fields from parameters, calling other constructors with this(), and passing the current instance.

Chapter 36: static Keyword in Java — Class Members, Utilities, and What static Cannot Do
Learn Java static fields and methods: belonging to the class not instances, static blocks, calling from static context, and why static cannot touch instance fields directly.

Chapter 37: final Keyword in Java — Variables, Methods, and Classes
Learn Java final on variables, parameters, methods, and classes: reassignment rules, blank final fields, preventing override, and stopping subclassing.

Chapter 38: Encapsulation in Java — private Fields, getters, setters, and Invariants
Learn Java encapsulation: hiding fields with private, exposing controlled access via methods, validation in setters, and a BankAccount-style example without inheritance yet.

Chapter 39: Inheritance in Java — extends, super, and Method Overriding Basics
Learn Java inheritance: extends, parent and child classes, super for constructors and members, @Override, when inheritance helps, and when composition is safer.

Chapter 40: Polymorphism in Java — One Type, Many Behaviors, and Runtime Dispatch
Learn Java polymorphism: substitutability, parent references to child objects, dynamic method dispatch, instanceof, and how it pairs with inheritance and overriding.

Chapter 41: Method Overriding in Java — @Override, Rules, static vs Instance, and super
Learn Java method overriding: @Override, access modifiers, return types, exceptions, hiding static methods, calling super, and mistakes that break substitutability.

Chapter 42: Abstraction in Java — Hiding Complexity and Defining Contracts
Learn abstraction in Java as an idea: essential vs accidental detail, contracts vs implementation, and how abstract classes and interfaces express abstraction in code.

Chapter 43: Abstract Class in Java — abstract Methods, Partial Templates, and Construction
Learn Java abstract classes: abstract and concrete methods, cannot instantiate, constructors for subclasses, when to choose abstract class vs interface, and template method style.

Chapter 44: Interface in Java — implements, Multiple Types, default and static Methods
Learn Java interfaces: implements, implicit public abstract methods, constants, default and static interface methods, functional interfaces preview, and common pitfalls.

Chapter 45: Abstract Class vs Interface in Java — How to Choose Without Memorizing Rules
Compare Java abstract classes and interfaces in plain language: shared code vs pure contracts, single class inheritance, when to combine both, and small exercises to build judgment.

Chapter 46: Access Modifiers in Java — public, protected, Default, and private Explained Slowly
Learn Java access levels: who can see classes, fields, and methods across packages and subclasses, plus common packaging mistakes and tiny experiments to build intuition.

Chapter 47: What is Exception in Java — When Normal Flow Stops and Objects Carry the News
Introduce Java exceptions without jargon first: failed assumptions, objects that describe the problem, stack traces as breadcrumbs, checked vs unchecked preview, and calm debugging habits.

Chapter 48: try-catch in Java — Handling Errors Without Pretending They Never Happened
Learn Java try and catch: execution order, catching specific types, multi-catch, variable scope, logging vs swallowing, and a small parser example you can extend.

Chapter 49: finally Block in Java — Cleanup That Runs Even When Things Go Sideways
Learn Java finally: order of execution with try and catch, interaction with return, why it is not a full safety net, and how try-with-resources often replaces manual closing.

Chapter 50: throw Keyword in Java — Sending an Exception Up the Call Stack on Purpose
Learn the Java throw statement: creating exception objects, when to throw instead of returning error codes, guard clauses, and wrapping lower-level failures in clearer messages.

Chapter 51: throws Keyword in Java — Telling Callers a Method May Propagate Checked Trouble
Learn Java throws on method signatures: checked exceptions, who must handle or declare, call-chain rules, and a tiny file-read style example without relying on memorized APIs.

Chapter 52: Checked vs Unchecked Exception in Java — What the Compiler Nagging Really Marks
Contrast Java checked and unchecked exceptions: compile-time handling rules, RuntimeException subtree, design tradeoffs, and small examples you can tweak in the IDE.

Chapter 53: Custom Exception in Java — Your Own Types for Domain-Specific Failures
Create Java exception subclasses: extend Exception or RuntimeException, add fields and constructors, keep messages useful, and know when checked custom types help or hurt an API.

Chapter 54: What is Collection Framework in Java — Baskets, Maps, and Why Arrays Are Not Enough
Introduce the Java collections mindset: dynamic sizing, standard interfaces like List and Map, iteration without index arithmetic, and how the next chapters tour concrete classes.

Chapter 55: List Interface in Java — Ordered Sequences, Indexes, and What Every List Promises
Learn the Java List interface: positional get and set, add, remove, size, subList view, iterating with for-each, and why you declare List but often instantiate ArrayList or LinkedList.

Chapter 56: ArrayList in Java — Resizable Array Backing, Fast get, Careful remove
Learn ArrayList in Java: backing array growth, amortized cost mental model, iterator remove vs foreach, capacity hints, and common Integer-removal pitfalls.

Chapter 57: LinkedList in Java — Nodes, Deques, and When Links Beat Arrays
Learn Java LinkedList as a doubly linked list: fast head-tail add and remove, List and Deque APIs, why middle access is slower than ArrayList, and sane use cases.

Chapter 58: ArrayList vs LinkedList in Java — Picking the List That Matches Your Access Pattern
Compare ArrayList and LinkedList in Java: get and add complexity stories, memory layout, iterator wins, and practical rules of thumb without treating Big-O as religion.

Chapter 59: Set Interface in Java — Uniqueness, No Positional Index, and equals/hashCode
Learn the Java Set interface: no duplicate elements, no get(i), iteration order depends on implementation, and why hash-based sets care about equals and hashCode contracts.

Chapter 60: HashSet in Java — Hash Buckets, Fast contains, and One null Element
Learn HashSet in Java: how hash codes pick a bucket, equals decides duplicates, average O(1) add and contains, null allowance, and why iteration order is not your API contract.

Chapter 61: LinkedHashSet in Java — Uniqueness Plus Predictable Iteration Order
Learn LinkedHashSet in Java: insertion-ordered linked buckets on top of hash tables, when to pick it over HashSet, memory tradeoff, and LRU-style hints without building a full cache yet.

Chapter 62: TreeSet in Java — Sorted Unique Elements and NavigableSet Extras
Learn TreeSet in Java: red-black tree idea, natural ordering with Comparable, custom Comparator, higher/lower navigation, and costs compared to HashSet and LinkedHashSet.

Chapter 63: Map Interface in Java — Keys to Values, No Duplicate Keys, Three Core Operations
Learn the Java Map interface: put get remove, keys values entrySet, Map vs Collection, null key/value notes at a high level, and declare Map but instantiate HashMap in Chapter 64.

Chapter 64: HashMap in Java — Hash Buckets for Keys, Fast get, and put Return Value
Learn HashMap in Java: put get remove, old value from put, computeIfAbsent, load factor at a glance, HashMap vs Hashtable naming history without worshiping legacy APIs.

Chapter 65: REST API with PostgreSQL in Core Java — HttpServer, JDBC, and Pieces You Already Learned
Build a tiny REST-style JSON API with JDK HttpServer and PostgreSQL JDBC: classes for data and storage, try-with-resources, SQLException, ArrayList, manual JSON strings, and SQL you can paste into psql.

Chapter 66: LinkedHashMap in Java — Stable Key Order on Top of HashMap Speed
Learn LinkedHashMap in Java: insertion-ordered key iteration, predictable entrySet walks, memory vs HashMap, LRU access-order mode at a glance, and when to choose it over TreeMap.

Chapter 67: TreeMap in Java — Sorted Keys, subMap Ranges, and NavigableMap Tools
Learn TreeMap in Java: red-black tree backing, natural ordering or Comparator, log-cost get and put, range views like subMap, and when sorted keys beat LinkedHashMap.

Chapter 68: Queue in Java — FIFO Lines, Deque Ends, and ArrayDeque as Default
Learn the Java Queue and Deque interfaces: offer poll peek, FIFO vs stack, ArrayDeque vs LinkedList, BlockingQueue preview, and clear habits for bounded work lists.

Chapter 69: PriorityQueue in Java — Heap Order, Comparable Keys, and Not-So-FIFO Iteration
Learn PriorityQueue in Java: internal binary heap, natural ordering vs Comparator, O(log n) offer and poll, why iterator order differs from poll order, and sensible use cases.

Chapter 70: Iterator in Java — Walk Collections, remove Safely, and Fail-Fast Behavior
Learn the Java Iterator interface: hasNext next remove, enhanced for-loop wiring, ConcurrentModificationException and modCount, and ListIterator peek for lists.

Chapter 71: Comparable and Comparator in Java — Natural Order vs Plug-In Sort Rules
Learn Comparable compareTo, Comparator compare, Collections.sort and List.sort, static Comparator helpers, consistent-with-equals pitfalls, and TreeSet or TreeMap ordering ties.

Chapter 72: What are Generics in Java — Type Parameters, Safety at Compile Time, and Erasure
Introduce Java generics: angle-bracket type parameters, why raw types hurt, type inference with the diamond operator, erasure at runtime, and mental models before generic classes and methods.

Chapter 73: Generic Class in Java — Type Parameters on Your Own Box and Factory Helpers
Define generic classes in Java with type parameters T, multiple parameters K V, static caveats, instance coherence, and simple Pair or Holder patterns without frameworks.

Chapter 74: Generic Method in Java — Type Parameters on a Single Method, Inference, and Wildcards
Learn generic methods in Java: <T> before return type, type inference at call sites, bounded parameters preview, PECS-style wildcards at a high level, and static utility patterns.

Chapter 75: Bounded Type Parameter in Java — extends, super, and Reading vs Writing Collections
Learn bounded generics in Java: T extends Number, wildcards ? extends and ? super, PECS mnemonic for APIs, and why copyFrom(List<? extends T>) differs from addTo(List<? super T>).

Chapter 76: Lambda Expression in Java — Compact Blocks, Target Typing, and Effectively Final
Learn Java lambda syntax: parameters arrow body, target types and SAM interfaces, capturing locals, effectively final rules, and when a method reference reads cleaner than a lambda.

Chapter 77: Functional Interface in Java — SAM Types, @FunctionalInterface, and Built-in Families
Learn Java functional interfaces: single abstract method rule, default and static methods allowed, @FunctionalInterface compiler help, and how Runnable fits the same pattern as Predicate.

Chapter 78: Predicate in Java — boolean Tests, and, or, negate, and Stream filter
Learn java.util.function.Predicate: test method, combining predicates, negation, isEqual helper, and using filter on streams without drowning in syntax.

Chapter 79: Function in Java — map Transformations, compose, and identity
Learn java.util.function.Function: apply, compose and andThen chaining, identity helper, primitive specializations at a glance, and map on streams and Optional.

Chapter 80: Consumer in Java — Side Effects, andThen Chaining, and Iterable forEach
Learn java.util.function.Consumer: accept void return, andThen sequencing, BiConsumer pairs, Iterable.forEach style, and balancing clarity with mutation.

Chapter 81: Supplier in Java — Lazy Values, Optional.orElseGet, and Stream.generate
Learn java.util.function.Supplier: get with no arguments, deferring expensive work, Optional factory patterns, and Stream.generate for infinite-style sequences with limit.

Chapter 82: Stream API in Java — Pipeline, Lazy Intermediates, and One Terminal
Introduce Java Stream: source to intermediate ops to terminal, laziness until a terminal runs, no storage guarantee, parallel stream caution, and how stream differs from a Collection.

Chapter 83: filter in Java — Predicates on a Stream, Short-Circuit Friends, and takeWhile
Deepen Stream.filter: Predicate per element, stateless habit, dropWhile and takeWhile on ordered streams, and combining predicates before or inside the pipeline.

Chapter 84: map in Java — Transform Each Element, mapToInt, and flatMap One Level
Learn Stream.map and primitive map variants, flatMap for one-to-many expansion, avoiding null returns, and when map chains read clearer than nested loops.

Chapter 85: collect in Java — Collectors, toList, joining, groupingBy, and Mutable vs Immutable
Learn Stream.collect with Collector, Collectors.toList and toUnmodifiableList, joining delimiter, simple groupingBy, and why collect is a terminal that materializes results.

Chapter 86: reduce in Java — Fold a Stream, Identity vs Optional, and Order Caution
Learn Stream.reduce: accumulator binary operator, identity element, empty stream behavior, combiner role in parallel streams, and when collect fits better than reduce.

Chapter 87: Optional in Java — Explicit Absence, map flatMap, and Avoiding Optional Fields
Learn java.util.Optional: empty vs of, map flatMap chain, orElse vs orElseGet, orElseThrow, stream findFirst, and why Optional member fields are usually discouraged.

Chapter 88: Method Reference in Java — Static, Bound, Unbound, and Constructor Shorthand
Learn Java method references: Type::staticMethod, instance::instanceMethod, Type::instanceMethod, Class::new, array constructors, and when a lambda stays clearer.

Chapter 89: Date and Time API in Java — LocalDate, LocalTime, ZonedDateTime, and Period vs Duration
Learn java.time: immutable values, LocalDate LocalTime LocalDateTime, ZoneId and ZonedDateTime, Period and Duration, DateTimeFormatter basics, and why legacy Date Calendar fade for new code.

Chapter 90: File Handling Introduction in Java — Paths, Bytes vs Text, Encoding, and IOException
Introduce Java file IO concepts: Path vs File, text vs binary, character sets, checked IOException, try-with-resources preview, and how the next chapters read files and write files safely.

Chapter 91: Reading File in Java — Bytes, Characters, Paths, and Choosing a Strategy
Read files in Java with Path and Files: readAllBytes readString newBufferedReader, charset choice, streaming large files with InputStream, and IOException handling patterns.

Chapter 92: Writing File in Java — Create, Truncate, Append, and Atomic Moves
Write files in Java with Files.writeString write, StandardOpenOption, creating parent directories, newline habits, and safe patterns for logs and exports.

Chapter 93: BufferedReader in Java — readLine, lines(), Mark, and Wrapping Readers
Learn BufferedReader: buffering semantics, readLine and EOF, lines stream, mark reset limits, and wrapping InputStreamReader for byte-to-text bridges.

Chapter 94: Files Class in Java — copy move walk exists mismatch, and Attribute Views
Use java.nio.file.Files for create delete copy move walk, isSameFile mismatch, probeContentType cautiously, and readAttributes for metadata without extra syscalls when possible.

Chapter 95: Try-with-resources in Java — AutoCloseable, Suppressed Exceptions, and Custom Cleanup
Learn try-with-resources: AutoCloseable close order, suppressed exceptions from close, effectively final resources, and migrating old finally-close patterns safely.

Chapter 96: What is Thread? in Java — Concurrency, the JVM, and Why Parallelism Shows Up Everywhere
Understand what a thread is in Java: OS threads and the JVM, the main thread, concurrency vs parallelism, and when splitting work across threads actually helps.

Chapter 97: Thread Class in Java — start vs run, Naming, Priorities, and Daemon Threads
Use java.lang.Thread: start versus run, thread names and IDs, priority as a hint, daemon threads, and why subclassing Thread is usually the wrong default.

Chapter 98: Runnable Interface in Java — Task vs Thread, Lambdas, and Composition
Implement java.lang.Runnable to separate work from Thread lifecycle, use lambdas for short tasks, and see why Runnable fits executors and testing better than subclassing Thread.

Chapter 99: Thread Lifecycle in Java — States, sleep, join, and Interrupt Cooperation
Map Java Thread.State NEW through TERMINATED, understand RUNNABLE vs blocked waiting, and use sleep, join, and interrupt correctly for cooperative lifecycle control.

Chapter 100: synchronized Keyword in Java — Monitors, Intrinsic Locks, and Reentrant Mutual Exclusion
Use synchronized methods and blocks for mutual exclusion on the intrinsic monitor, understand reentrancy, and avoid holding locks while calling alien code or blocking on I/O.

Chapter 101: volatile Keyword in Java — Visibility, Happens-Before, and What It Does Not Fix
Use volatile for safe publication and visibility of writes across threads, understand happens-before with reads, and avoid mistaking volatile for atomicity on read-modify-write.

Chapter 102: ExecutorService in Java — Thread Pools, submit vs execute, and Graceful Shutdown
Use ExecutorService and Executors factories for pooled workers, choose execute vs submit, and shut down with shutdown, awaitTermination, and shutdownNow without orphaning tasks.

Chapter 103: Callable and Future in Java — Typed Results, Exceptions Through get, and Timeouts
Use Callable for tasks that return a value and throw checked exceptions, consume results with Future get and timeouts, cancel work, and compare Callable to Runnable for executor.submit.

Chapter 104: CompletableFuture in Java — Async Pipelines, thenApply, exceptionally, and ForkJoinPool
Build async pipelines with CompletableFuture supplyAsync and thenApply, handle failures with exceptionally, choose join vs get, and know the commonPool defaults for async stages.

Chapter 105: What is JDBC? in Java — API Bridge, URL, and the sql Package Mental Model
Learn what JDBC is: the Java layer between your code and relational databases, core types in java.sql, SQLException, and how JDBC fits beside JPA and Spring Data later in the series.

Chapter 106: JDBC Driver in Java — Classpath, ServiceLoader, and Picking a Type-4 Driver
Understand JDBC drivers: Type 4 thin drivers, automatic registration via ServiceLoader, classpath versus module path, and how the JDBC URL selects which Driver accepts the connection.

Chapter 107: Connection in Java — DriverManager, try-with-resources, Timeouts, and Transactions
Use java.sql.Connection from DriverManager.getConnection, set auto-commit and network timeouts, validate with isValid, and close connections reliably with try-with-resources.

Chapter 108: PreparedStatement in Java — Bound Parameters, executeUpdate vs executeQuery, and Generated Keys
Use PreparedStatement for parameterized SQL, set types with setString setInt setNull, choose executeQuery vs executeUpdate, and read RETURNING or getGeneratedKeys safely.

Chapter 109: ResultSet in Java — next, Column Access, wasNull, and Forward-Only Cursors
Navigate rows with ResultSet.next, read columns by label vs index, use wasNull after getInt, understand TYPE_FORWARD_ONLY default, and close ResultSet in try-with-resources.

Chapter 110: CRUD with JDBC in Java — Create Read Update Delete in One Small Repository
Implement JDBC CRUD with PreparedStatement and try-with-resources: insert with generated keys, select by id, update, delete, optional transactions, and keep SQL in one repository-shaped class.

Chapter 111: SQL Injection Prevention in Java — Parameters, Allow-Lists, and Second-Order Surprises
Prevent SQL injection in Java JDBC: always bind values with PreparedStatement, never concatenate user input into SQL, use allow-lists for identifiers and sort keys, and watch second-order injection through stored data.

Chapter 112: What is API? in Java — Contracts, Boundaries, and Why Network APIs Matter
Learn what an API is: a contract between producer and consumer, in-process libraries versus HTTP APIs, resources and operations, and how Java code on both sides relies on stable shapes.

Chapter 113: REST API in Java — Resources, HTTP Verbs, Statelessness, and Pragmatic REST
Understand REST-style HTTP APIs: resources and representations, stateless requests, common verb usage, HATEOAS as optional richness, and how Java services expose REST without frameworks first.

Chapter 114: HTTP Methods in Java — GET POST PUT PATCH DELETE, Safety, and Idempotency
Map HTTP methods to intent: safe GET and HEAD, idempotent PUT and DELETE, POST for creation and actions, OPTIONS for discovery, and set methods correctly on java.net.http.HttpRequest.

Chapter 115: HTTP Status Codes in Java — 2xx 3xx 4xx 5xx and Mapping Them in Clients
Use HTTP status codes correctly: success 200 201 204, redirects 301 302, client errors 400 401 403 404 409 422, server errors 500 502 503, and branch on HttpResponse.statusCode in Java HttpClient.

Chapter 116: JSON Request and Response in Java — Content-Type, Escaping, and Parsing Choices
Work with JSON over HTTP in Java: set Content-Type and Accept, build JSON strings safely, avoid manual parsing at scale, and choose Jackson or Gson vs minimal hand-built JSON for learning.

Chapter 117: Building API with Java — HttpServer, Handlers, JSON Responses, and Thread Model
Build a minimal HTTP API with JDK com.sun.net.httpserver.HttpServer: contexts, HttpHandler, response codes, JSON bodies, and notes on threading limits before Spring Boot in the series.

Chapter 118: What is Spring Boot? in Java — Convention, Starters, and the Embedded Server
Understand Spring Boot: opinionated configuration on Spring Framework, starters and auto-configuration, fat JARs with embedded servers, actuator hooks, and when Boot is the right default for Java services.

Chapter 119: Spring Boot Project Structure in Java — Packages, Layers on Disk, and Test Layout
Lay out a Spring Boot project: groupId and base package, main application class, resources vs java sources, application.yaml, static and templates, and mirror packages in src/test/java.

Chapter 120: Controller Layer in Java — RestController, Mappings, Request/Response DTOs
Build the web layer in Spring Boot: @RestController, @GetMapping @PostMapping, path variables and request params, HTTP status with ResponseEntity, and keep controllers thin by delegating to services.

Chapter 121: Service Layer in Java — @Service, Transactions, and Orchestrating Repositories
Design the service layer in Spring Boot: @Service stereotype, @Transactional boundaries, orchestrating repositories, domain rules, and why controllers should call services not JDBC directly.

Chapter 122: Repository Layer in Java — Spring Data JPA, JpaRepository, and Query Ownership
Model the repository layer in Spring Boot: Spring Data JPA interfaces, JpaRepository and derived query methods, @Query when needed, transactions at the service boundary, and keep SQL readable and reviewed.

Chapter 123: Entity in Java — JPA @Entity, IDs, Mappings, and Persistence State
Model JPA entities in Spring Boot: @Entity and @Table, @Id and @GeneratedValue, basic column mappings, relationships overview, and equals/hashCode pitfalls with lazy proxies.

Chapter 124: DTO in Java — API Shapes, Records, Mapping from Entities, and Versioning
Use DTOs in Spring Boot: separate HTTP JSON from JPA entities, prefer records for immutable API models, map in the service layer, and evolve APIs without leaking database columns.

Chapter 125: Dependency Injection in Java — IoC Container, Constructor Injection, and @Bean
Understand Spring dependency injection: Inversion of Control, singleton-scoped beans by default, constructor injection over field injection, @Configuration classes, and conditional beans.

Chapter 126: Request Validation in Java — Jakarta Validation, @Valid, and Consistent 400 Responses
Validate HTTP requests in Spring Boot with jakarta.validation constraints on DTOs, @Valid on controller parameters, MethodArgumentNotValidException handling, and custom validators when needed.

Chapter 127: Global Exception Handling in Java — @RestControllerAdvice, ProblemDetail, and Stable Error JSON
Centralize Spring MVC error handling with @RestControllerAdvice and @ExceptionHandler, return consistent JSON for validation and domain errors, and use ProblemDetail on supported Spring Boot versions.

Chapter 128: REST API CRUD Example in Java — Layered Spring Boot Flow from GET to DELETE
Tie together a Spring Boot REST CRUD example: controller routes, DTOs and validation, service transactions, JPA repository, status codes for create read update delete, and global errors for 404 and validation.

Chapter 129: Reflection in Java — Class Objects, Members, setAccessible, and When to Stop
Use Java reflection safely: Class.forName, getDeclaredMethods and getMethods, Field get/set, Method invoke, setAccessible and module checks, and prefer compile-time APIs unless frameworks require reflection.

Chapter 130: Serialization in Java — Serializable, serialVersionUID, JSON vs Java Binary
Understand Java serialization: Serializable marker, serialVersionUID, ObjectOutputStream risks, evolution rules, and why production services prefer JSON or protobuf over native binary serialization.

Chapter 131: Records in Java — Compact Data Carriers, Canonical Constructor, and Immutability
Use Java records for immutable data aggregates: generated accessors, equals hashCode toString, compact constructors for validation, and records vs Lombok POJOs and JPA entities.

Chapter 132: Sealed Classes in Java — permits, Closed Hierarchies, and Exhaustive switch
Use sealed classes and interfaces in Java: permits clause, same-module rules, non-sealed escape hatches, and exhaustive pattern matching over sealed hierarchies.

Chapter 133: Java Modules in Java — module-info, requires exports opens, and JPMS Boundaries
Learn the Java Platform Module System: module-info.java requires transitive exports opens to, strong encapsulation by default, services, and how modules interact with unnamed code and the classpath.

Chapter 134: ClassLoader in Java — Delegation, Visibility, and Isolation Patterns
Understand ClassLoader chains: delegation model, defining vs initiating loaders, visibility between loaders, URLClassLoader patterns, and why duplicate classes on different loaders break equals.

Chapter 135: JVM Memory Management in Java — Heap, Stack, Metaspace, and Native Off-Heap
Map JVM memory regions: heap generations for objects, thread stacks and frames, metaspace for class metadata, direct buffers and native memory, and how flags like Xmx Xms relate to tuning.

Chapter 136: Garbage Collection in Java — Pauses, Collectors G1 ZGC, and Practical Tuning Mindset
Understand Java garbage collection: unreachable object reclamation, stop-the-world pauses, G1 as default collector, ZGC Shenandoah for low latency goals, and logs versus guessing with flags.

Chapter 137: Authentication vs Authorization in Java — Identity, Scopes, and Where Each Runs
Separate authentication and authorization in Java backends: login vs permission checks, sessions vs tokens, roles and scopes, Spring Security filters at a high level, and common 401 vs 403 mistakes.

Chapter 138: JWT Basics in Java — Claims, Signature, Expiry, and Stateless Trade-offs
Learn JWT structure for Java APIs: header payload signature, standard claims like exp and aud, verifying with public keys JWKS, rotation, and why JWTs are credentials not authorization by themselves.

Chapter 139: Password Hashing in Java — Argon2id, bcrypt, PBKDF2, and Spring Security Crypto
Hash passwords safely in Java: adaptive algorithms, salts and pepper, work factors, BCryptPasswordEncoder and delegating encoders, and never compare plaintext or roll crypto alone in production.

Chapter 140: Input Validation in Java — Boundaries, Allow-Lists, File Uploads, and API Hardening
Harden Java APIs with input validation beyond bean validation: size limits, allow-lists for enums and sorts, filename and path safety, multipart limits, and defense in depth with WAF and auth.

Chapter 141: CORS in Java — Preflight, Allowed Origins, and Spring WebMvcConfigurer
Configure CORS for Java REST APIs: browser same-origin policy, preflight OPTIONS, Access-Control-* headers, credentials mode, and safe Spring Boot patterns with allowCredentials and explicit origins.

Chapter 142: Logging in Java — SLF4J, Logback, Levels, and Structured Fields
Log effectively in Java services: SLF4J facades, Logback configuration, log levels, correlation IDs, MDC, JSON logs for aggregation, and what never to log (passwords, tokens, full PII).

Chapter 143: API Versioning in Java — URL Path, Headers, Content Negotiation, and Deprecation
Version public Java HTTP APIs: path prefixes like /v1, Accept header negotiation, compatibility rules, deprecation headers, and coordinating clients, docs, and release trains.

Chapter 144: Pagination in Java — Offset vs Keyset, Pageable, and Stable Sort Keys
Paginate data in Java APIs: LIMIT OFFSET trade-offs, keyset pagination for large datasets, Spring Data Pageable, total count costs, and cursor encoding for mobile feeds.

Chapter 145: Rate Limiting in Java — Token Buckets, Gateways, and Fairness
Protect Java APIs with rate limiting: why limits exist, per-IP and per-API-key strategies, token bucket intuition, Redis-backed limits at scale, and gateway vs application enforcement.

Chapter 146: Swagger/OpenAPI in Java — Contracts, springdoc-ui, and Generated Clients
Document and exercise Java APIs with OpenAPI 3: YAML vs annotations, springdoc-openapi with Spring Boot, Swagger UI for try-it-out, and generating clients or server stubs from the spec.

Chapter 147: Testing with JUnit in Java — JUnit 5, Lifecycle, Assertions, and Test Slices
Write tests with JUnit 5: @Test, lifecycle annotations, assertions and parameterized tests, nested tests, extensions, and Spring Boot test slices like @WebMvcTest and @DataJpaTest at a glance.

Chapter 148: Mockito in Java — Mocks, Stubs, verify, and Test Doubles in Spring
Isolate units with Mockito: mock interfaces, when thenReturn, verify interactions, @Mock and @InjectMocks, lenient stubs, and integrating with SpringExtension for slice tests.

Chapter 149: Clean Code in Java — Naming, Functions, Comments, and Honest Complexity
Apply clean code habits in Java: intention-revealing names, small functions, guard clauses, few parameters, meaningful comments only, error handling clarity, and refactoring fearlessly with tests.

Chapter 150: Production-Level Java Project Structure in Java — Modules, Config, Observability, Delivery
Structure production Java services: multi-module Maven or Gradle boundaries, environment-specific config, health metrics tracing, container images, CI pipelines, and runbooks alongside code.

Chapter 151: Java Roadmap and Practice Projects in Java — What to Build Next and How to Deepen Skills
Close the 151-chapter Java guide with a practical roadmap: consolidate core Java, Spring, data, concurrency, and production skills through deliberate practice projects and continued learning habits.

Complete Java Roadmap: From Core Java to Advanced Java, APIs, and Best Practices
A practical Java learning roadmap covering core syntax, OOP, collections, Java 8+, JDBC, REST APIs, Spring Boot, security, testing, and production habits—written for developers who want to go from beginner to job-ready.

What Is Java and Why Should You Learn It? A Beginner-Friendly Guide
Discover what Java is, where it runs in the real world, and why beginners still pick it for backend, Android, and enterprise careers—with honest pros and no hype.