What is Object Oriented Programming

OOP is clean approach to working with data
Posted on 01/26/2025 11:58
by Mickey Mouse
Tags: php |
7 8 15

Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior.

Important components of OOP:

  1. Class: A class is a user-defined data type.
    It consists of data members and member functions, which can be accessed and used by creating an instance of that class. It represents the set of properties or methods that are common to all objects of one type. A class is like a blueprint for an object.
    For Example: Consider the Class of Cars. There may be many cars with different names and brands but all of them will share some common properties like all of them will have 4 wheels, Speed Limit, Mileage range, etc. So here, Car is the class, and wheels, speed limits, mileage are their properties.

  2. Object: It is a basic unit of Object-Oriented Programming and represents the real-life entities.
    An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is instantiated (i.e. an object is created) memory is allocated. An object has an identity, state, and behavior.
    Each object contains data and code to manipulate the data.
    Objects can interact without having to know details of each other’s data or code, it is sufficient to know the type of message accepted and type of response returned by the objects.
    For example “Dog” is a real-life Object, which has some characteristics like color, Breed, Bark, Sleep, and Eats.
Show All Blog Posts