ProgrammingLearning library

Java foundations

Develop readable Java programs and learn the language, collections, and JVM workflow.

Beginner20 chapters14 practice questions6 references
Start coursePractise questions

Get an in-app notice when new lessons or practice are added.

20 chapters across 7 modules

Course chapters

Explore all 20 chapters in any order. Each chapter has learning goals, a practice prompt, and a primary reference; expanded reading pages are linked from their chapter titles.

01 · Language foundations4 chapters
  1. JDK, compilation, and execution

    Follow source code, compilation, bytecode, and the Java runtime.

    • Distinguish source code, bytecode, and the JVM

    Practice: Compile and run a small class and inspect a compile error.

    Read the primary referenceExpanded reading · Ready
  2. Variables and primitive types

    • Choose types and identify conversions that can lose information

    Practice: Represent counts, prices, and flags with suitable types.

    Read the primary referenceLesson guide · Ready
  3. Control flow and methods

    • Trace branches, loops, parameters, and return values

    Practice: Implement a grade classifier with threshold tests.

    Read the primary referenceLesson guide · Ready
  4. Arrays and strings

    • Distinguish array indexing and immutable String values

    Practice: Count vowels while handling an empty input.

    Read the primary referenceLesson guide · Ready
02 · Object-oriented Java4 chapters
  1. Classes and constructors

    Model a small Java object around responsibilities and invariants.

    • Initialize valid object state through a constructor

    Practice: Model a library item with a title and available-copy count.

    Read the primary referenceExpanded reading · Ready
  2. Encapsulation and validation

    • Keep invariants inside the object that owns its state

    Practice: Reject an invalid booking capacity through a public method.

    Read the primary referenceLesson guide · Ready
  3. Interfaces and polymorphism

    • Program against a contract with multiple implementations

    Practice: Create two notification senders behind one interface.

    Read the primary referenceLesson guide · Ready
  4. Inheritance and composition

    • Evaluate reuse through delegation before extending a class

    Practice: Refactor a report object to receive a formatter dependency.

    Read the primary referenceLesson guide · Ready
03 · Collections and generics2 chapters
  1. Lists, sets, and maps

    • Select a collection according to duplicates, order, and key lookup

    Practice: Implement a word-frequency map.

    Read the primary referenceLesson guide · Ready
  2. Generics and type safety

    • Explain type parameters and avoid unchecked raw collections

    Practice: Write a typed repository of simple records.

    Read the primary referenceLesson guide · Ready
04 · Resources and functional processing2 chapters
  1. Exceptions and resource handling

    • Distinguish expected failures and use try-with-resources

    Practice: Read a file and report a missing resource clearly.

    Read the primary referenceLesson guide · Ready
  2. Streams and lambdas

    • Read a stream pipeline and compare it with a loop

    Practice: Filter and group a small collection without side effects.

    Read the primary referenceLesson guide · Ready
05 · Building applications4 chapters
  1. Packages and project structure

    • Organize code into coherent packages with clear dependencies

    Practice: Separate model, service, and command-line entry code.

    Read the primary referenceLesson guide · Ready
  2. Testing and debugging

    • Design deterministic tests around behavior and edge cases

    Practice: Test a price calculation and fix a reproduced failure.

    Read the primary referenceLesson guide · Ready
  3. Concurrency foundations

    • Distinguish shared state, tasks, and synchronization needs

    Practice: Explain a counter race and compare safe alternatives.

    Read the primary referenceLesson guide · Ready
  4. Mini project: library tracker

    • Combine classes, collections, persistence, and tests

    Practice: Create a small library tracker with a documented input format.

    Read the primary referenceLesson guide · Ready
06 · Working with application boundaries3 chapters
  1. Records and immutable data

    • Describe value-oriented data carriers and the limits of shallow immutability

    Practice: Model a small event with a record and document mutable component risks.

    Read the primary referenceLesson guide · Ready
  2. Database access with JDBC

    • Separate parameterized SQL, connection lifetime, and transaction boundaries

    Practice: Outline a transactional update using prepared statements.

    Read the primary referenceLesson guide · Ready
  3. JVM observation

    • Distinguish heap use, garbage collection, threads, and application latency

    Practice: Investigate a fictional memory-growth incident using a measurement plan.

    Read the primary referenceLesson guide · Ready
07 · Further foundations and worked reasoning1 chapter
  1. Collections and contracts

    Compare ordered entries, uniqueness, and key-based lookup before choosing an implementation.

    • Choose collection behavior by ordering, equality, mutability, and operation needs

    Practice: Compare a list, set, and map using duplicate records and mutable keys.

    Read the primary referenceExpanded reading · Ready

Learn it. Check it. Try again.

14 original questions with worked explanations and source references. Filter by difficulty, revisit mistakes, and save your attempt as you go.

Open Java foundations practice

In-depth study guide

Follow the subject from its foundations through worked examples and practice. Each guide includes its scope, version assumptions, solutions, and sources for further study.

OpenLearning study guideEdition 2026.12

Java: From Source Code to Reliable Applications

An original in-depth guide to Java execution, values, control flow, methods, collections, objects, interfaces, equality, generics, errors, streams, testing, concurrency, and a command-line project.

pages
94
chapters
16
diagrams
12
exercises with solutions
32

8,648 words of explanations and practice · 18 worked examples · 16 review questions

Improve this guide on GitHubOriginal text · CC BY-SA 4.0

Browse all study guides

Books & references

Free reading at the publisher or author’s site. External materials keep their own licenses.