What OOP is — and why Git matters
Four pillars + four Git words
Presentations from class
What you must be able to explain
- OOP organizes code around objects that hold data and behavior together
- The four pillars: classes & objects, inheritance, polymorphism, encapsulation
- A class is a blueprint; an object is a living instance created with new
- Inheritance builds a new class on top of an existing one with extends
- Polymorphism: same method name, different behavior in subclasses
- Encapsulation: an object protects its own data and exposes safe methods
- Git fundamentals: repository, commit, remote, push — and why this course requires history
class Student {
constructor(name) {
this.name = name;
}
greet() {
return `Hi, I'm ${this.name}`;
}
}
const jm = new Student('JM');
console.log(jm.greet());Lines worth memorising
Class = blueprint. Object = the thing you actually use.
If you can name the four pillars with one example each, you are ready for the concept questions.