I have to write a hash function, under the following two conditions: I don\'t know anything about Object o that is passed to the method - it can be a String, and Integer, or an actual custom object;
I have a HashMap with coordinates as keys. Coordinates have 3 longs holding the x, y and z coordinate. (Coordinate is and needs to be a custom class, the coordinates need to be longs).
I have a pretty complex object and I need to get uniqueness of these objects. One solution can be done by overriding GetHashCode(). I have implemented a code noted below: