130k views
2 votes
What is an abstract data type?

User James Lin
by
7.4k points

1 Answer

5 votes

Answer:

Abstract data type is a datatype which hides all the implementation details to the end user.

Step-by-step explanation:

Class is an abstract data type in object oriented programming. Class abstracts both data members and member functions implementation. Here we can hide some confidential data from end user using access specifier "private". We can make end user access only the data which is marked as "public".

example:

public class Calculate

{

private int salary;

public int workingHours;

public int reatePerHour;

public void Calcuate(){

int total=workingHours*reatePerHour;

cout<<total;

}

}

Here class calculates hides the implementation details of the method "Calculate" .We are abstracting implementation details to the end user using "Class" data type. So it is an AbstarctDataType

User Phoneswapshop
by
8.0k points

No related questions found