Free degree-level programming lessons for careful independent study.
Degree Level Programmes

Programming 2

A second-semester Java programming portfolio course extending software engineering practice through collections, abstraction, exceptions, recursion, event-driven programming, patterns and team artefacts.

Lessons

Lesson 1 · Building blocks

Program Structure Review

Revisit Java program structure and strengthen naming, packaging, cohesion and readable control flow.

Lesson 2 · Maintainable state

Scope and Lifetime

Manage where names are visible, how long values live and why smaller scope usually makes code easier to reason about.

Lesson 3 · Data structure foundations

The Array

Understand arrays as fixed-size indexed storage and compare them with higher-level collection classes.

Lesson 4 · Object-oriented design

Objects, Encapsulation and Abstraction

Model program concepts as objects with private state, public behaviour and clear abstractions.

Lesson 5 · Object-oriented reuse

Inheritance for Reuse

Use inheritance carefully as one form of reuse, while recognising when composition is easier to maintain.

Lesson 6 · Pragmatic design choices

Controlled Boundary Breaking

Understand that design rules sometimes bend, but every boundary break needs a clear reason and a maintenance cost.

Lesson 7 · Flexible substitution

Polymorphism: Cost and Benefit

Use polymorphism to substitute behaviours while understanding the readability, indirection and performance trade-offs.

Lesson 8 · Data structures

Collections, Generics and Iteration

Use ArrayList, HashMap, generics and enhanced iteration to manage changing data safely.

Lesson 9 · Efficiency

Time, Space and Speed Trade-offs

Compare simple design choices using execution time, memory use, readability and scale.

Lesson 10 · Abstraction

Interfaces and Higher-Level Abstractions

Use interfaces and polymorphism to separate what code needs from how it is implemented.

Lesson 11 · Robustness

Exceptions and Defensive Programming

Use exceptions, validation and recovery paths to handle errors without hiding real problems.

Lesson 12 · Algorithms

Recursion, Sorting and Searching

Understand recursive thinking and connect it to searching and sorting examples.

Lesson 13 · Events

Event-Driven Programming

Build a small event-driven Java program where user actions trigger program behaviour.

Lesson 14 · Readable interfaces

Operator-Style API Design

Learn from operator overloading by designing methods whose names and behaviour fit the domain without hiding surprising work.

Lesson 15 · Type-safe reuse

Generic Reuse

Use Java generics as a maintainable form of reuse and compare the idea with template-style generated code.

Lesson 16 · Resource management

Resource Lifecycle and Cleanup

Understand cleanup as a lifecycle issue: files, streams and resources should be closed when their useful extent ends.

Lesson 17 · Patterns

Design Patterns in Practice

Use selected design patterns carefully: immutability, factory methods, singleton risks and composition.

Lesson 18 · Team software engineering

Team Workflow and Version Control

Coordinate a team artefact using issues, branches, commits, reviews and integration discipline.

Lesson 19 · Applied programming

Specialism Mini-Project

Build a small artefact connected to a later computing specialism such as HCI, security, games, data or software engineering.

Lesson 20 · Portfolio synthesis

Final Portfolio and Reflection

Assemble three stronger artefacts with evidence of requirements, design, implementation, testing, teamwork and reflection.