Computer Science, asked by Nilkanth1, 1 year ago

what is abstraction implemented in c++ ?


babydoll: mark PIPI's as brainliest

Answers

Answered by pipi
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 Abstraction

Abstraction 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: 9

Note: 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.


pipi: plz mark it as brainliest
Nilkanth1: thanks friend
babydoll: nilkanth1,mark it as brainliest
babydoll: my one was very short
shubh29: pls mark brainliest
Answered by Karam
0
abstraction refers to, providing only essential information to the outside world and hiding their background details

babydoll: very short
Similar questions