Difference between ADT and Classes?

ajknzhol picture ajknzhol · Feb 2, 2014 · Viewed 10.8k times · Source
ADT is the set of operations. ADT's are mathematical abstractions.

Does this mean that ADT are same as classes or am i confusing both together ?

Answer

Bernhard Barker picture Bernhard Barker · Feb 2, 2014

The key to the difference is abstract. Think of an ADT more like an interface - a class with only method declarations, no implementation details.

As an example, a Stack ADT defines the basic stack operations like push and pop (but says nothing of how these operations should be implemented), while a Stack class would use either a linked-list or an array to actually implement these operations.