Basic Concepts of OOP - Advantage of OOPs over Procedural programming | OOP Tutorial in C++ -02

Basic Concepts of  OOP - Advantage of OOPs over Procedural programming | OOP Tutorial in C++ -02

What is object-oriented programming language?

A programming paradigm that is completely based on ‘objects’ is known as object-oriented programming language. 

Object-oriented programming is more secure than procedural programming languages, because of the level of abstraction or we can say data hiding property.

What are the four basic concepts of object-oriented programming?

Object-oriented programming has four basic concepts: encapsulation, abstraction, inheritance and polymorphism.

· Encapsulation

· Abstraction

· Inheritance

· Polymorphism

What is Inheritance in OOP?

Inheritance is the capability of one class to acquire properties and characteristics from another class. It is used to achieve runtime polymorphism.

When one object acquires all the properties and behaviours of parent object i.e. known as inheritance. Inheritance makes the code reusable. 

What is Polymorphism in OOP?

Polymorphism is considered as one of the important features of Object Oriented Programming. Polymorphism means having multiple forms of one thing.

Polymorphism allows the object to behave differently in different conditions. It is a greek words that are “Poly” and “morphs” and basically translates to ‘many forms’.

When one task is performed by different 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 Function overriding to achieve polymorphism.

What is Abstraction in OOP?

Abstraction in C++ is the process to hide the internal details and showing functionality only.

Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing.

 Abstraction can be achieved by two ways:

1. Abstract class

2. Interface

What is Encapsulation in OOP?

Encapsulation means the process of wrapping up the data and functions in a single capsule.

Encapsulation also lead to data abstraction or hiding. As using encapsulation also hides the data.

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

The common example of encapsulation is Capsule. In capsule all medicine are encapsulated in side capsule.

What is the advantages of OOP concept programming over procedural programming?

Advantage of OOPs over Procedure-oriented programming language:

1. OOP makes development and maintenance easier.

2. OOP provides data hiding.

3. OOP provide ability to simulate real-world event much more effectively.

4. OOP is faster and easier to execute

5. OOP provides a clear structure for the programs

6. OOP helps to keep the code DRY "Don't Repeat Yourself".

7. OOP makes it possible to create full reusable applications with less code and shorter development time.

8. Modularity for easier troubleshooting.

9. OOP gives flexibility through polymorphism.

10. OOP gives better productivity.

Next Post:  What is Class & Object in OOP ~ Difference Between Structure and Class -03

Previous Post: What is OOP? Philosophy of Object Oriented Programming (OOP) | OOP Tutorial in C++

0 Response to Basic Concepts of OOP - Advantage of OOPs over Procedural programming | OOP Tutorial in C++ -02

Post a Comment