- It allows uns to create data types not otherwise available in a programming language
- It allows us to produce off-the-shelf-software, pieces of software that can be used over and over again in different programs by any programmer
An abstract data type has both a specification (the what) and an implementation (the how)
Properties of abstract data types
- Attributes
- Java: fields
- C++: data members or member variables
- Oprations
- Java: methods
- C++: member functions
- Public attributes
- Public operations
Example of informal specification
TYPE
IntList
DOMAIN
Each IntList value is a collection of up to 100 separate integer numbers
OPERATIONS
Insert an item into the list
Delete an item from the list
Return the current length of the list
Print the list
Notice the complete absense of implementation details
Reference: wikipedia, google books, thefreedictionary