HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

C++ OOP

OOP:

OOP stands for Object-Oriented Programming.Procedural programming is about writing procedures or functions that perform operations on the data, while object-oriented programming is about creating objects that contain both data and functions.

Advantages of OOP:


Classes and Objects


Classes and objects are the two main aspects of object-oriented programming.

Look at the following illustration to see the difference between class and objects:


Class


Fruit

Objects


Apple

Banana

Mango


So,a class is a template for objects, and an object is an instance of a class.When the individual objects are created, they inherit all the variables and functions from the class.