Search code examples
javainterfaceabstract-data-type

Relationship between Interfaces and Abstract Data Type in Java


This is not about abstract class vs interfaces.

I hope someone can explain the relationship between interface and ADT in Java. I think of an interface as a group of abstract methods. I understand that ADT focuses on what operations are possible but don't tell how they are implemented. I read that an interface specifies the operations of an ADT, but don't fully understand what this mean.

Thanks


Solution

  • An Abstract Data Type is a purely theoretical entity. It´s inception precedes object orientation.

    On the other side, interfaces are concrete constructions used in Java and other OO languages to indicate the methods that a class must implement.

    Something that may confuse you is that Java interfaces, are abstract types, and not abstract data types.