Outline any four features of Object-Oriented Programming OOP, giving examples in each case.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.4: Class Inheritance And Polymorphism
Problem 3E
icon
Related questions
Question

Outline any four features of Object-Oriented Programming OOP, giving examples in each case.                                                                           

  

Expert Solution
Step 1

Four features of Object-Oriented Programming (OOP):

i) Abstraction

  • The term abstraction refers to the fact that units in Object-Oriented Programming does not indicate the detailed design or implementation.
  • That is, the classes only specify the functionality of the outside world using objects without providing the implementation details of member functions.
  • Example: Employee class will have a method getEmployeeCredential without providing the complete details like from where the data is fetched or how to fetch the data.

ii) Polymorphism:

  • This concept states that the same entity can exist in many forms in Object-Oriented Programming.
  • For example, a function getArea() will return the area of the figure based on the number and type of arguments passed to it, Like the area of circle, rectangle, triangle.

//for circle

getArea(radius);

//for rectangle

getArea(length, breadth);

  • That is, same name with many forms. Similarly, operators can be overloaded in Object-Oriented Programming languages like C and C++.
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Processes of 3D Graphics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr