public class QueueImpl<E extends Comparable<E>>
{
private int count;
private class Node
{
private E info;
Node next;
}
Node front;
Node rear;
public E peekMaximum()
{
Node temp = new Node();
temp = front;
Node max = new Node();
max = temp;
while(temp!=null)
{
System.out.println(temp.info);
//if(temp.info>max)
if((temp).compareTo(max))>0) // getting error here
//if(((Integer)(temp.info) - (Integer)(max.info)) >0)
{
max = temp;
}
temp=temp.next;
}
return max.info;
}
}
i have implemented my own queue . now i want to find object having maximum value.
how should i compare the two objects?