Java Double hashCode() methodThe hashCode() method of Java Double class returns the hash code for this Double. The result is obtained by performing exclusive OR operation on two halves of the long integer bit representation which is same as produced by the doubleToLongBits() method. OverridesThe hashCode() method of class Double overrides the hashCode() method of class Object SyntaxParameters1.NA 2.value - is the double value provided to hash Return valueThis method returns a hash code value for this double object. Example 1Test it NowOutput: 1. Hash Value = -1330324172 2. Hash Value = 1079230464 3. Hash Value = -482480461 4. Hash Value = 1637418694 Example 2Test it NowOutput: Enter your Adhar card No 5678 Your visit id is: 1085681152 Example 3Test it NowOutput: HAsh code value = 1079476224 Float value = 1079476224 Example 4Test it NowOutput: Error:(12, 35) java: incompatible types: int cannot be converted to java.lang.Double
Next TopicJava Double
|