posted 16 years ago
Java API says if we have any mutable object in Set, and if we modify that object in such a way that equals method is effected then Set behavior is not specified
Here Ele class object is mutable, initially the object of this class t3 is added to Set with value of x as 50,then its value is changed to 60, and the property x is used in equlas method so modification to x value will effect its behavior.
SCJP 1.5 94%.
The greatest glory in living lies not in never falling, but in rising every time we fall.