0

By the title, I mean what is simply and exactly an abstract data type? Is it a class that has special form or ways to put the methods?

c0der
  • 18,467
  • 6
  • 33
  • 65
Kira Nofans
  • 176
  • 1
  • 6
  • 20
  • 1
    You should probably remove the adt tag, since it's for Android Development Tools, not for abstract data type. I'd also spell this out in the title, to avoid confusion. – Robert Oct 24 '16 at 02:52
  • Surely you've Googled the phrase "abstract data type" by now. What did you find, and what part(s) didn't make sense to you? – Kevin J. Chase Oct 24 '16 at 03:33

1 Answers1

3

An abstract data type represents a model of a data structure which specifies basic characteristics of data and the operations which can be performed on it. For instance, in Java the List interface is a good example. This is an interface and it's not some particular implementation. It defines what data it deals with (a collection of something) and a set of operations like add(), addAll(), clear() etc. The examples of particular implementations are ArrayList, LinkedList, Stack etc. By implementing the List interface these classes become "Lists" themselves.

There are many other examples of abstract data types in Java. This is just one of the examples. Hope this helps.

Nurjan
  • 5,889
  • 5
  • 34
  • 54
  • So ADT only exists when implementing a list class or classes for data structure? And the reason why it's abstract is that it has nothing to do with database or files? And it just creates temporary stored records or tables, and just one of the ways of data structuring? – Kira Nofans Oct 24 '16 at 03:21
  • Everything is mixed up in your question. ADT has nothing to do with databases, although an ArrayList can contain objects which represent entries from a database. Think of ADT as an abstract concept (don't confuse it with abstract class in Java) which defines some data model, e.g. Interfaces List, Map etc. The classes like ArrayList, LinkedList, HashMap are concrete implementations of these abstract concepts (interfaces). If you look at the source code of theses classes, then you will see particular implementations of methods defined in their interfaces. – Nurjan Oct 24 '16 at 03:28