Object-Oriented Programming (OOP)
Exam Power Notes — Quick Revision Guide
1. OOP Basics
Object-Oriented Programming organizes software around objects and classes. Objects contain data (attributes) and
behavior (methods).
2. Class vs Object
A class is a blueprint or template. An object is an instance created from that class. Example: Car is a class; a
particular car is an object.
3. Four Pillars
Encapsulation: bundle data and methods and control access.
Abstraction: hide unnecessary implementation details.
Inheritance: derive a new class from an existing class.
Polymorphism: allow the same interface or operation to have different behavior.
4. Constructor
A constructor/initializer prepares a new object with initial values. In Python, __init__() is commonly used for
initialization.
5. Inheritance
Common forms include single, multilevel, multiple, and hierarchical inheritance. It supports reuse and class
relationships.
6. Polymorphism
Polymorphism means 'many forms'. Method overriding is a common example: a child class provides its own
implementation of a parent method.
7. Encapsulation
Encapsulation helps protect internal state and keeps related data and behavior together. Access-control mechanisms
vary by programming language.
8. Abstraction
Abstraction exposes essential functionality while hiding internal complexity. A user can call a method without knowing
every implementation step.
9. Advantages
Code reuse, modular design, easier maintenance, controlled data access, flexible behavior, and easier modeling of
complex systems.
10. OOP vs Procedural
Procedural programming emphasizes procedures/functions and operations; OOP emphasizes objects, classes, and
their relationships. Programs can combine both approaches.
Exam Power Notes — Quick Revision Guide
1. OOP Basics
Object-Oriented Programming organizes software around objects and classes. Objects contain data (attributes) and
behavior (methods).
2. Class vs Object
A class is a blueprint or template. An object is an instance created from that class. Example: Car is a class; a
particular car is an object.
3. Four Pillars
Encapsulation: bundle data and methods and control access.
Abstraction: hide unnecessary implementation details.
Inheritance: derive a new class from an existing class.
Polymorphism: allow the same interface or operation to have different behavior.
4. Constructor
A constructor/initializer prepares a new object with initial values. In Python, __init__() is commonly used for
initialization.
5. Inheritance
Common forms include single, multilevel, multiple, and hierarchical inheritance. It supports reuse and class
relationships.
6. Polymorphism
Polymorphism means 'many forms'. Method overriding is a common example: a child class provides its own
implementation of a parent method.
7. Encapsulation
Encapsulation helps protect internal state and keeps related data and behavior together. Access-control mechanisms
vary by programming language.
8. Abstraction
Abstraction exposes essential functionality while hiding internal complexity. A user can call a method without knowing
every implementation step.
9. Advantages
Code reuse, modular design, easier maintenance, controlled data access, flexible behavior, and easier modeling of
complex systems.
10. OOP vs Procedural
Procedural programming emphasizes procedures/functions and operations; OOP emphasizes objects, classes, and
their relationships. Programs can combine both approaches.