C
Chanchal
hi,
In an application i'm developing, i have a class say X and
an arraylist of X ie,
list = new ArrayList<X>() ;
and i have added an object of X into list
list.add(x); // x ib object of X
and i'm calling the contains() function of the arraylist to check if an
object of X, say 'y' is in there.
I have overridden the equals() method in X and it returns true for
x.equals(y).
But the contains() method returns false. what could be the reason.
please advice
Chanchal
In an application i'm developing, i have a class say X and
an arraylist of X ie,
list = new ArrayList<X>() ;
and i have added an object of X into list
list.add(x); // x ib object of X
and i'm calling the contains() function of the arraylist to check if an
object of X, say 'y' is in there.
I have overridden the equals() method in X and it returns true for
x.equals(y).
But the contains() method returns false. what could be the reason.
please advice
Chanchal