Vol 1: Programming Basics
This volume builds the core vocabulary of programs: types, control flow, methods, objects, collections, concurrency, and I/O. Each concept is tied to observable output and explicit failure boundaries, turning syntax from trivia into behavior.
Prerequisites
- Complete the environment setup in Vol 0 and confirm that
javaandjavaccome from a working JDK. This volume uses Java 17 language and API contracts. - You only need to create source files, navigate to their directory, and run commands. Give independent experiments separate directories so repeated class names do not overwrite one another.
Coverage
The volume contains 15 chapters and 62 lessons. Short programs lead into shared objects, threads, and files; labs check successful output alongside deliberate failures.
Chapter 1: Java Programs and Their Errors
- 1.1 Hello World, Your First Program
- 1.2 Java Code, Line by Line
- 1.3 Basic Syntax Rules for Java
- 1.4 Common Compilation and Runtime Errors
- 1.5 Lab: Fix Errors, Change Output, Test Entry Points
Chapter 2: Variables, Types, and Conversion
- 2.1 Variables, Assignment, and Scope
- 2.2 Primitive Types: Ranges and Limits
- 2.3 Numeric Conversion, Promotion, and Precision
- 2.4 Lab: Variables, Types, and Conversion
Chapter 3: Expressions and Operators
- 3.1 Expressions, Assignment, and Evaluation Order
- 3.2 Arithmetic, Division, and Remainders
- 3.3 Comparisons, Equality, and Short-Circuit Logic
- 3.4 Lab: Expressions and Operators
Chapter 4: Branches and Loops
- 4.1 if, else and Conditional Boundaries
- 4.2 switch Statements and Expressions
- 4.3 while, for, and Iteration
- 4.4 break, continue, return and Labels
- 4.5 Lab: Branches, Loops, and Boundaries
Chapter 5: Methods and Recursion
- 5.1 Why Methods Help
- 5.2 Method Declarations and Calls
- 5.3 Parameters, Return Values, and Pass-by-Value
- 5.4 Overload Resolution and API Design
- 5.5 Call Stack, Stack Frames, and Stack Traces
- 5.6 Introduction to Recursion
- 5.7 Recursion Depth, Repeated Work, and Tail Calls
- 5.8 Lab: Methods, Pass-by-Value, and Overloading
Chapter 6: Arrays and Copying
- 6.1 Array Variables, Objects, and Elements
- 6.2 Array Indexing and Traversal
- 6.3 Array Copying, Utilities, and Varargs
- 6.4 Multidimensional Arrays and Shape Validation
- 6.5 Lab: Array Operations and Debugging
Chapter 7: Objects, Encapsulation, and Class State
- 7.1 From Parallel Arrays to Objects
- 7.2 Fields, Methods, and this
- 7.3 Constructors and Object Invariants
- 7.4 Encapsulation and Access Boundaries
- 7.5 Static Members and Class-Level State
- 7.6 Lab: Object Invariants and Common Pitfalls
Chapter 8: Inheritance, Polymorphism, Lambdas, and Streams
- 8.1 Inheritance and Subtype Contracts
- 8.2 Polymorphism and Dynamic Dispatch
- 8.3 Method Overriding, @Override, and super
- 8.4 Abstract Classes, Interfaces, and Object
- 8.5 Lab: Inheritance, Interfaces, and Polymorphism
- 8.6 Lambda Expressions and Functional Interfaces
- 8.7 Stream API and Collection Pipelines
- 8.8 Lab: Lambda and Streams
Chapter 9: Strings and Encoding
Chapter 10: Collection Costs and Contracts
- 10.1 Introduction to the Collection Framework
- 10.2 List Costs, Views, and Updates
- 10.3 Map and Set Contracts
Chapter 11: Exceptions and Resource Cleanup
Chapter 12: Generics and Type Erasure
- 12.1 Type Parameters and Generic Methods
- 12.2 Invariance, Wildcards, and PECS
- 12.3 Type Erasure and Runtime Boundaries
Chapter 13: Annotations and Reflection
Chapter 14: Threads, Synchronization, and Executors
- 14.1 Thread Creation and Lifecycle
- 14.2 Synchronization, Communication, and Deadlocks
- 14.3 Thread Pools and Task Results
Chapter 15: I/O and Filesystems
Outcomes
- Explain Java evaluation order, conversions, and method dispatch well enough to account for a program’s output.
- State object and collection invariants and test their boundaries with runnable positive and negative examples.
- Handle exceptions, cancel threads, and close I/O resources while distinguishing process-local correctness from persistence guarantees.
How to use this map
Read in lesson order the first time. Chapter 8 introduces dynamic dispatch before detailing overriding rules. During review, follow the symptom: lost precision points to Chapters 2–3, collection behavior to Chapter 10, a process that will not exit to Chapter 14, and partial file writes to Chapter 15. Run the example, check its output, then change one boundary condition.