write equals():
I personally think it is very readable,
Thank you all for your replies.
I like this style of coding it! Neat.
Would someone like to elaborate on how overloading equals could break container classes?
I think I may have found one answer to my question here:
http://csis.pace.edu/~bergin/Java/OOJavaFAQ.html If you overload equals you will have two different equals methods in your class. However, the compiler and libraries know about the inherited one and call it from a number of places--the HashMap add method, for example. You have to realize that these calls will still go to the inherited method and not to the overloaded one. If you want to write a method to check equality of objects rather than depend on the default behavior of the inherited equals method (reference equality), then you need to override equals, NOT overload it.
This seems to tie in with advice I have seen that one must also override hashCode when overriding equals.
Zambian