top of page
Writer's pictureParidhi Gangwal

C++ | OOPs Concepts

Updated: Jun 11, 2020

Object Oriented Programming may be a paradigm that gives many concepts like inheritance, data binding, polymorphism etc.

The programming paradigm where everything is represented as an object is understood as truly object-oriented programming language .

Small talk is considered as the first truly object-oriented programming language.


OOPs (Object Oriented Programming System)


Object means a true word entity like pen, chair, table etc.

Object-Oriented Programming may be a methodology or paradigm to style a program using classes and objects. It simplifies the software development and maintenance by providing some concepts:

  • Object

  • Class

  • Inheritance

  • Polymorphism

  • Abstraction

  • Encapsulation


Object:


Any entity that has state and behavior is understood as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical.


Class:


Collection of objects is called class. It is a logical entity.


Inheritance:


When one object acquires all the properties and behaviors of parent object i.e. known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism.


Polymorphism:


When one task is performed by alternative ways i.e. known as polymorphism. For example: to convince the customer differently, to draw something e.g. shape or rectangle etc.

In C++, we use Function overloading and performance overriding to realize polymorphism.


Abstraction:


Hiding internal details and showing functionality is understood as abstraction. For example: call,we do not know the interior processing.

In C++, we use abstract class and interface to realize abstraction


Encapsulation:


Binding (or wrapping) code and data together into a single unit is understood as encapsulation. For example: capsule, it is wrapped with different medicines.


Advantage of OOPs over Procedure-oriented programming language-

  1. OOPs makes development and maintenance easier where as in Procedure-oriented programming language it's tough to manage if code grows as project size grows.

  2. OOPs provide data hiding whereas in Procedure-oriented programming language a worldwide data are often accessed from anywhere.

  3. OOPs provide ability to simulate real-world event far more effectively. We can provide the answer of real word problem if we are using the Object-Oriented programming language.

 

Follow us on Instagram @programmersdoor

Join us on Telegram @programmersdoor


Please write comments if you find anything incorrect, or you want to share more information about the topic discussed.

Follow us on Instagram and telegram for more updates

20 views0 comments

Recent Posts

See All

Comments


bottom of page