I understand that ADTs (abstract data types) hide/abstract the implementation of a method. So, an interface is an ADT, correct? So my questions are:
public interface MyStack {
public void push();
public void pop();
public void peek();
}
public class ImplementationOfMyStack implements MyStack {
public void push() {
System.out.println("Code an implementation here to push a new item on top.");
System.out.println("The implementation is a data structure e.g. linked List.");
}
public void pop() {
System.out.println("Code an implementation here to pop a new item from top.");
System.out.println("The implementation is a data structure e.g. linked List.");
}
public void peek() {
System.out.println("Code an implementation here to peek a new item from top.");
System.out.println("The implementation is a data structure e.g. linked List.");
}
}