An abstract data type (ADT) is a mathematical model for data types, defined by its behavior from the point of view of a user of the data, specifically in terms of possible values and possible operations on data of this type. ADTs are a way of encapsulating data and operations on that data into a single unit. The definition of an ADT only mentions what operations are to be performed but not how these operations will be implemented. It does not specify how data will be organized in memory and what algorithms will be used for implementing the operations. It is called “abstract” because it gives an implementation-independent view.
ADTs are important in object-oriented programming and design by contract methodologies for software development. They allow interchangeable software modules, as modules with the same functional behavior but different implementation details can be used interchangeably. ADTs also provide better conceptualization of the data structure and allow for customization of data structures depending on how they are planned to be used.
Examples of ADTs include list, stack, and queue. The interface of an ADT specifies the operations that can be performed on the data, but not how they are implemented. The implementation details are hidden from the user of the ADT, which allows for greater modularity and easier maintenance of code.