3.2 Core Concepts of OOP
Object Oriented Programming Using Python
Object-Oriented Programming (OOP) has several core concepts that make programs organized, reusable, and easier to manage. These concepts include classes and objects, encapsulation, inheritance, and polymorphism.
Classes and Objects – Representing Real-World Entities in Code
A class is a blueprint or template that defines the properties (attributes) and actions (methods) of an entity. An object is an instance of a class that holds actual values for its attributes (as shown in Figure 3.1). Classes and objects allow programmers to model real-world entities in code. Using classes and objects helps organize data and related functionality together, making programs more structured.
Example