/******************************************************************************
 * Creating a Queue class by extending the LinkedList class
 ******************************************************************************/
import java.util.*;

public class Queue<E>  extends LinkedList<E>            //Notice use of generic
{
    public void push(E item)                            //receives a generic type
    {
        super.addLast(item);                            //Java LinkedList has a push( ) --> addFirst( )
    }                                                   //except, I want to add to the end

    public E pop()                                      //returns a generic type
    {
        return super.removeFirst();                     //Java LinkedList has a pop( ) --> removeFirst( )
    }                                                   //no need to overwrite

    //if you like, you can override other LinkedList methods to disable them

    public boolean add(E item) {return false;}          //disable add(E item)
    public void add(int i, E item) {}                   //disable add(int i, E item)
    public void addFirst(E item) {}                     //disable addFirst(E item)
}

//-----------------------------------------------------------------------------------------