Possible Duplicate:
How is hashCode() calculated in Java
I know every objects generated in java has hashcodes and also there can be two different objects with the same hashcode.So, i dont know hashcode generation depends on the object type or something else...
Can you suggest me about how hashcodes are implemented in java or what does it depends(based) on?
hashcodes are usualy implemented for each object and are calculated using the fields that make that object unique and to comply with the hashcode equals contract. If left unimplemented the hashcode of the super class will be used.
The "default implementation" will be objects hashcode which is calculated using it's memory address also known as pointer.