// Create a queue class using the MyList class // Since a queue does not allow insertions anywhere but the end and removals anywhere but the beginning, we have to // override several methods to "disallow" them, and also add methods to insert (always at the end) and remove (always at the beginning) import java.util.*; public class MyQueue extends MyList { public MyQueue() { alist = new ArrayList(); } @Override public void insertAtFront(String a) { System.out.println("Illegal operation, queues do not permit insertions at the front"); } @Override public void insert(int i, String a) { System.out.println("Illegal operation, queues do not permit insertions anywhere but at the end"); } @Override public String removeFromEnd() { System.out.println("Illegal operation, queues do not permit removal from the end"); return null; } @Override public String remove(int i) { System.out.println("Illegal operation, queues do not permit removal anywhere but at the front"); return null; } public void insert(String a) { super.insertAtEnd(a); } public String remove() { return super.removeFromFront(); } }