what is abstraction implemented in c++ ?
babydoll:
mark PIPI's as brainliest
Answers
Answered by
5
Abstraction in C++
Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context.
Hiding of data is known as data abstraction. In object oriented programming language this is implemented automatically while writing the code in the form of class and object.
Real life example of AbstractionAbstraction shows only important things to the user and hides the internal details for example when we ride a bick, we only know about how to ride bick but can not know about how it work ? and also we do not know internal functionality of bick.
Example of Abstraction in C++#include<iostream.h> #include<conio.h> class sum { // hidden data from outside world private: int a,b,c; public: void add() { clrscr(); cout<<"Enter any two numbers: "; cin>>a>>b; c=a+b; cout<<"Sum: "<<c; } }; void main() { sum s; s.add(); getch(); }OutputEnter any two number: 4 5 Sum: 9Note: Data abstraction can be used to provide security for the data from the unauthorized methods.
Note: Note: In C++ language data abstraction can be achieve by using class.
Answered by
0
abstraction refers to, providing only essential information to the outside world and hiding their background details
Similar questions