OOPS - Object-Oriented Programming System

OOPS refers to a programming paradigm based on the concept of "objects", which can contain data (attributes) and code (methods). OOPS principles help in organizing complex programs, making them more modular, reusable, and easier to maintain.

OOPS_Logo.png

Class

A blueprint or template for creating objects. It defines attributes (variables) and methods (functions) that the objects will have.

Object

An instance of a class. Multiple objects can be created from the same class, each with access to its attributes and methods.

__init__ (Constructor)

A special method that is automatically called when a new object is created. It’s typically used to initialize the object’s attributes.

self

A reference to the current instance of the class. It is used to access variables and methods within the class.

Encapsulation

The practice of hiding internal data and methods to protect object integrity. In Python, prefixing variables with double underscores (__) makes them private to the class.

Abstract Class

A class that cannot be instantiated directly. It may contain abstract methods (methods without implementation) that must be defined in its child classes. Defined using the abc module.

Inheritance

A mechanism where a class (child/subclass) inherits attributes and methods from another class (parent/superclass). The super() function is used to call methods or access variables from the parent class.

Polymorphism

The ability for methods with the same name to behave differently based on context, such as different parameters or object types.