Part 1 — Java Fundamentals
3 lectures (CM) · 5 lab sessions (TD) · ~4 weeks
Objectives
By the end of Part 1 you will be able to:
- Write and compile Java programs using Maven and VSCodium
- Understand the key differences between Java and Python
- Design classes with proper encapsulation, constructors, and toString()
- Use
ArrayList,HashMap, andStack - Handle exceptions with try/catch and write custom exception classes
- Read and write text files
- Apply inheritance, abstract classes, and interfaces
- Override
equals()andhashCode()
Thread: the Car class
All three CMs and TDs share a common example — the Car class — which grows in complexity across the three sessions:
- CM1/TD1 — basic
Car: fields, constructor, toString(), references - CM2/TD2 —
FleetManager:HashMap<String, Car>, custom exceptions, file I/O - CM3 —
ElectricCar,Convertible,Startable: inheritance, overriding, interfaces — TD3 then applies these ideas to freshShape&Animalhierarchies
Resources
| Resource | Link |
|---|---|
| Setup tutorial | VSCodium & Maven |
| CM1 slides | |
| CM2 slides | |
| CM3 slides | |
| TD1 | VSCodium, Maven & Car |
| TD-Git | Version Control with Git |
| TD2 | Collections & Exceptions |
| TD3 | Inheritance & Polymorphism |
| TD-Modern | Modern Java — Streams, Records & Lambdas |
| Bonus TD | Polynomial Arithmetic |