import java.util.LinkedList; public class Myqueue { private LinkedList<Object> linkedList; public Myqueue() {
linkedList = new LinkedList<>();
} public void intoMyqueue(Object o) {
linkedList.add(o);
} public Object outMyqueue() {
int size = linkedList.size(); if (size > 0)
return linkedList.remove(0);
else
return -1;
}
public int getSize() {
return linkedList.size();
} }