Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 11, 2005, 09:29 PM   #1
Dr. No
macrumors regular
 
Join Date: Sep 2003
Abstract Data Types

Can someone explain what an Abstract Data Type is in Java? Plus, what does it look like, and what does it do?
__________________
It's all about the Pentiums.
Dr. No is offline   0 Reply With Quote
Old Dec 11, 2005, 10:31 PM   #2
kanaka
macrumors member
 
Join Date: Jul 2002
Quote:
Originally Posted by Dr. No
Can someone explain what an Abstract Data Type is in Java? Plus, what does it look like, and what does it do?
An Abstract Data Type (ADT) in any programming language is an entity that is only defined by the type of data stored and the operations that may be performed on that data. That is, the operations of an ADT are defined in a public interface, but the specific way in which the operations are implemented is hidden within the ADT. The person using the ADT doesn't need to know anything about the implementation details.

A common example of an ADT is a list. A list may have a set of public methods to insert or remove objects, but the implementation details are hidden inside the ADT. The list might be implemented using an array or a linked-list, but the person using the class doesn't need to know or care about these details.

In Java, ADTs are frequently created by defining in interface, and then concrete classes "implement" the interface. http://java.sun.com/docs/books/tutor...interface.html
There are also Abstract classes and abstract methods in Java, but it sounds like you're asking more about the general ADT concept.

http://en.wikipedia.org/wiki/Abstract_data_type
kanaka is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Applescript: How do I create custom data types? moonman239 Mac Programming 1 Jan 5, 2013 11:07 PM

Forum Jump

All times are GMT -5. The time now is 02:57 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC