|
Brainhks thanks for the reply.
But I still have some doubts.
1)-- In the above code, equals method is called sometimes and sometimes it is not called. Can you or any one tell the reason for that.
2)-- When I set K2.i =1 the equals method is called and when I set k2.i=2 or with some other number the equals method is not called.
3)-- When i call the contains method after removing k2 both set.contains(k2) and set.contains(k1) are returning false. why is it so even when there is a value in the hashset.
4)-- Is the result same for the Hashtable and HashSet both same.
|