Professional Documents
Culture Documents
Lect 06
Lect 06
Lect 06
objStream.writeObject(obj);
calculateTax(employee[k]);
Abstract Data Types
Data Abstraction
• View data in an abstract way
• Formal definition:
An Abstract Data Type is a pair <V, O> where:
V is a set of values
O is a set of operations defined on V
• Abbreviate: ADT
Basic Data Types
• Types such as int, double, etc. are “built
in” ADTs
• In Java: private
Tower
disks, numDisks, ID
Tower
add, remove, getID
Interfaces and Data Abstraction
• Sometimes a client will use an object
defined by an interface