M
Mark
hi,
I was just wondering how I might get rid of this error.. can't seem to
figure it out.
the error:
warning: [unchecked] unchecked call to compareTo(T) as a member of the
raw type java.lang.Comparable
else if( o.compareTo(n.o) < 0 )
^
the function:
private void insert(Comparable o, Node n)
{
if( n == null )
n = new Node(o);
else if( o.compareTo(n.o) < 0 )
insert(o,n.l);
else
insert(o,n.r);
}
my node class:
class Node
{
public Object o = null;
public Node l = null;
public Node r = null;
Node(Object obj) {
o = obj;
}
}
thanks guys.
I was just wondering how I might get rid of this error.. can't seem to
figure it out.
the error:
warning: [unchecked] unchecked call to compareTo(T) as a member of the
raw type java.lang.Comparable
else if( o.compareTo(n.o) < 0 )
^
the function:
private void insert(Comparable o, Node n)
{
if( n == null )
n = new Node(o);
else if( o.compareTo(n.o) < 0 )
insert(o,n.l);
else
insert(o,n.r);
}
my node class:
class Node
{
public Object o = null;
public Node l = null;
public Node r = null;
Node(Object obj) {
o = obj;
}
}
thanks guys.