Module 5: Introduction to Object-Oriented Programming (OOP)
What is OOP? - Classes and Objects
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data in the form of fields (often known as attributes or properties) and code in the form of procedures (often known as methods).
- Class: A blueprint or template for creating objects. It defines a set of attributes and methods that the created objects will have. Think of a class like a cookie cutter.
- Object (Instance): An instance of a class. It's a concrete entity created from the class blueprint. Using the cookie cutter analogy, an object is an actual cookie made from the cutter.
Key principles of OOP often include encapsulation, inheritance, and polymorphism (though these are more advanced topics beyond the scope of an introductory module).