asked on
Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.
TRUSTED BY
The reason is that a Hashtable implemented in Java uses a combination of the equals() AND hashCode() methods to do its searching and storing of data.
It depends on what your doing, really. If this is a class that only YOU will be using, and you know that you won't be using a Hashtable to store your data, then you could get away without overriding hashCode. But if you're writing a class to be used in a programming library, then you should override hashCode so others using your class won't have problems.
baboo_