Queue<Integer>[] queues = new Queue[3];
for(int i=0;i<3;i++) {
queues[i] = new LinkedList<Integer>();
}
Queue thisqueue = queues[1];
while(thisqueue.peek()<10) {}
This is my java code. when I run this code the eclipse tell me The operator < is undefined for the argument type(s) Object, int
I can't understand I store everything in queue as Integer why it become object when I use peek()
.
How to fix this? I want to peek the tail number as int and compare with 10.