Best Viewed With Any Browser

Design of classes

Often a Java class declaration is used to produce a new type. This document argues that, for these class declarations, certain features should always be provided. In particular, the class should provide methods called equals and hashCode, and a means for cloning objects of the class. If it is appropriate, the class should also implement the Comparable interface (providing a method called compareTo). The document also discusses the code that should be used for equals, hashCode, compareTo and clone.

The text of the talk is available in the following formats:

The text of this document was last updated on 20th February 2001.
Here is a link to my Java/XML/C#/.NET/Web Services page.