This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
you must override them in order to deal with collections to check the objects are equal or not and hashcode too. Because some collections are storing datas according to the hash code value(Hashing algorithms). for eg. hashtable,HashMap,HashSet.
i hope this clears you.
Joined: Oct 13, 2008
ok i got it...
the String class and the wrapper classes have overridden the equals() method (inherited from class Object), so that you could compare two different objects (of the same type) to see if their contents are meaningfully equivalent.