Object-Oriented Programming (OOP)
1. Classes & Objects
A Class is a blueprint. An Object is an instance of that blueprint.
2. Encapsulation (Information Hiding)
Restricting access to data. In Python, we use a double underscore __ to make attributes Private. We then use Getters and Setters.
3. Inheritance & Overriding
A child class "inherits" all methods from a parent class. Overriding happens when the child changes a parent method.
4. Containment (Aggregation/Composition)
This describes a "Has-a" relationship. One class contains an object of another class as an attribute.
5. Overloading (Static Polymorphism)
Defining multiple methods with the same name but different parameters.
Note: Python does not support standard overloading natively like Java, but we simulate it with default arguments.
Key points for Paper 3/4: Code Reusability (via Inheritance), Maintainability (Modular design), and Security (via Encapsulation). In your blockchain project, you'd likely have a Vote object and a User object interacting!