Introduction to Object-Oriented Programming

Object-Oriented programming is a type of programming, in which everything is treated as an object. It is a programming paradigm.

Everything is based on objects and classes.

Object-oriented programming (OOP) is a programming paradigm that is based on the concept of “objects”, which are data structures that contain both data and functions. In object-oriented programming, objects are used to represent real-world entities and the functions associated with them.

C++ is a programming language that supports object-oriented programming. It has features such as classes, inheritance, and polymorphism, which are essential for object-oriented programming.

In C++, a class is a user-defined data type that defines the properties and behaviors of an object. It consists of member variables (data) and member functions (functions) that operate on the data. A class can be used to create multiple objects of the same type, which are called instances of the class.

Every high-level programming languages support this type of programming system, for example, C++, Java, Python, JavaScript, PHP, Pearl, Ruby, etc, but some exceptions are there.

Let us take an example, Student is an object in Object-Oriented having some properties (name, age, gender, etc) & methods (run, play, read)

Features of OOPs

There are many features of object-oriented programming following mentioned below, also called the four pillars of object-oriented programming.

  • Encapsulation
  • Abstraction
  • Polymorphism
  • Inheritance