Java OOP · Module 1
The four pillars, in plain words
A map of the whole course before you start coding it
What you'll be able to do
- Say what each of the four pillars means in one sentence
- Know which module teaches which pillar
- Recognise the pillar behind a design problem you are shown
Why OOP Exists
Encapsulation, Inheritance, Polymorphism, Abstraction
Four intimidating words for four simple ideas. Here they are before the details arrive.
One sentence each
private double balance + deposit(...) with validation.class Dog extends Animal.Animal a = new Dog(); a.sound(); prints the dog's sound.A restaurant
Encapsulation: you order from a menu; you do not walk into the kitchen. Inheritance: the vegetarian menu is the normal menu plus changes. Polymorphism: you say 'bring me the dish of the day' and each branch brings something different — same request, different result. Abstraction: the menu promises 'grilled chicken' without describing the oven.
Your roadmap
| Module | You will be able to |
|---|---|
| 2 – Classes & Objects | write classes, create objects, understand references |
| 3 – Constructors | guarantee an object is valid from birth |
| 4–5 – Encapsulation & Access | protect data with private + getters/setters + validation |
| 6–7 – Inheritance & Overriding | reuse behaviour and specialise it safely |
| 8–9 – Polymorphism & Overloading | write code that works with types invented later |
| 10–11 – Abstraction & Interfaces | design contracts instead of implementations |
| 12–13 – Relationships & Project | choose composition vs inheritance and build a bank system |
How to study from here on
Every concept from Module 2 onward ends with a Coding Challenge. Do not skip it and do not read the hints first: the point is to fail, read the feedback, and retry. Learn → Practice → Code → Test → Feedback → Retry → Master.
Common mistakes
Memorising the four words as definitions for an exam.Assuming inheritance is the most important pillar.Check understanding
Quiz
Question 1 of 3
A class hides its balance field and only allows changes through deposit/withdraw. Which pillar is that?
Summary
- Encapsulation = protect state behind behaviour (Modules 4–5).
- Inheritance = reuse and specialise a parent (Module 6).
- Polymorphism = one reference, many runtime behaviours (Modules 7–9).
- Abstraction = describe what must happen, not how (Modules 10–11).