Object Oriented Programming Concepts in JAVA Abstract Data

Object Oriented Programming Concepts in JAVA


Abstract Data Type (ADT) An abstract data type is a collection of data and operations that work on that data. The operations both describe the data to the rest of the program and allow the rest of the program to change the data.

Benefits of Using ADTs You can hide implementation details Changes don't affect the whole program You can make the interface more informative It's easier to improve performance The program is more obviously correct The program becomes more self-documenting You don't have to pass data all over your program You're able to work with real-world entities rather than with low-level implementation structures

Examples of ADTs

ADTs and Classes Abstract data types form the foundation for the concept of classes. In languages that support classes, you can implement each abstract data type as its own class. Classes usually involve the additional concepts of inheritance and polymorphism. One way of thinking of a class is as an abstract data type plus inheritance and polymorphism.

ﻣﻔﺎﻫیﻢ ﺑﺮﻧﺎﻣﻪ ﻧﻮیﺴی ﺷﺊ گﺮﺍ ﺩﺭ ﺟﺎﻭﺍ : ﺑﺮﺍی ﻣﺜﺎﻝ. ﺟﺎﻭﺍ ﺍکﺜﺮ ﻣﻔﺎﻫﻴﻢ پﺎیﻪ ﺷی گﺮﺍ یی ﺭﺍ ﺑﻪ ﻃﻮﺭ ﻣﺴﺘﻘیﻢ پﺸﺘیﺒﺎﻧی ﻣی کﻨﺪ Classification: Grouping related things together. Encapsulation: Representing data and the set of operations on the data as a single entity classes Information Hiding: An object should be in full control of its data, granting specific access only to whom it wishes. Inheritance: Java allows related classes to be organized in a hierarchical manner classes, inheritance & packages. extends Polymorphism: Same code behaves differently at different times during execution. dynamic binding.

- Slides: 8