What would be a good logic to create hashCode for multiple/complex datatypes.
Will the method java.lang.System.identityhashCode(Object o), be used in this case..
What are the pluses and minuses of this.
And what would be a better alternative..
I have the put in a sample source for better understanding..
Thanks folks,
I appreciate your valuable inputs..
eg:
------------------------------------------------
public class xyz{
BigDecimal a;
Long b;
Date c;
boolean d;
public xyz( BigDecimal a, Long b, Date c, boolean d)
{
// assign to the members..
}
public int hashCode()
{
// any help to fill-in here would be appreciated..
}
}
-----------------------------------------------
-
hashCode creation on multiple/complex datatype (0 messages)
- Posted by: Praveen Balakrishnan
- Posted on: August 27 2001 14:30 EDT