You are here:   HomeJava ProgrammingClasses in JavaWhat is abstract data type (ADT)?
by Dinesh Thakur Category: Classes

A DATA STRUCTURE which is accompanied by a set of ACCESS FUNCTIONS that must be employed to create objects of that type and access their contents, without the programmer being concerned with the internal layout of the data structure. The CLASSES employed in OBJECT-ORIENTED PROGRAMMING are abstract data types whose concealment is actually enforced by the language syntax, but abstract data types may be created in conventional languages such as C, PASCAL and MODULA-2 too, where the concealment is voluntary.

The purpose of an abstract data type is INFORMATION HIDING - that is, to prevent programmers from writing programs that depend on intimate details of the type's implementation that might be changed in future and could cause such programs to cease working correctly.

For example, an abstract data type that implements a STACK would hide from programmers the exact way the stack body is implemented (is it an array or is it a list?) thus preventing them from accessing it directly by making assumptions that may become invalid for future versions.

What's New and Popular