From 3425506574d5bcd84e35c57434a7b9e2225b40f8 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 7 Dec 2005 17:10:28 +0000 Subject: addressing 118877 --- docs/progGuideDB/examples.xml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'docs/progGuideDB/examples.xml') diff --git a/docs/progGuideDB/examples.xml b/docs/progGuideDB/examples.xml index 12c6d1ccc..2847f13d2 100644 --- a/docs/progGuideDB/examples.xml +++ b/docs/progGuideDB/examples.xml @@ -541,12 +541,16 @@ public aspect ComparablePoint { - The method Object.hashCode returns an unique - integer, suitable for use as a hash table key. Different - implementations are allowed return different integers, but must - return distinct integers for distinct objects, and the same integer - for objects that test equal. But since the default implementation - of Object.equal returns true + The method Object.hashCode returns an + integer, suitable for use as a hash table key. It is not required + that two objects which are not equal (according to the + equals method) return different integer + results from hashCode but it can + improve performance when the integer is used as a key into a + data structure. However, any two objects which are equal + must return the same integer value from a call to + hashCode. Since the default implementation + of Object.equals returns true only when two objects are identical, we need to redefine both equals and hashCode to work correctly with objects of type Point. For -- cgit v1.2.3