Originally posted by saransh panda:
for comparison between two objects we can use
[1] operator 'obj1==obj2'
[2] function 'obj1.equals(obj2)'
but what is the difference between them? And if they represent the same funcationality what is the significance of equals() function?
thankyou!
the == operator actually tests the equality of the reference variables, that is, if the two variables are referring to the same object. To
test the logical equality, that is, the equality of the object's state, we normally use the equals() method.
And welcome to the ranch
[ May 12, 2008: Message edited by: Balasubramanian Chandrasekaran ]