Double hashCode() method in Java with examples Last Updated : 12 Oct, 2018 Comments Improve Suggest changes Like Article Like Report The hashCode() method of Double class is a built-in method use to return the hashcode value of this Double object. Syntax: DoubleObject.hashCode() Parameters: It takes no parameters. Return Type: It returns an int value. The value returned is (int)(v^(v>>>32)) where v is a long variable equal to Double.doubleToLongBits(this.doubleValue()). Below is the implementation of hashCode() method: Example 1: Java // Java code to demonstrate // Double hashCode() Method class GFG { public static void main(String[] args) { double d = 118.698; // creating Double object. Double value = new Double(d); // hashCode() method Double class int output = value.hashCode(); // printing the output System.out.println("Hashcode Value of " + value + " : " + output); } } Output: Hashcode Value of 118.698 : 1215072837 Example 2: Java // Java code to demonstrate // Double hashCode() Method class GFG { public static void main(String[] args) { int i = -30; // creating Double object. Double value = new Double(i); // hashCode() method Double class int output = value.hashCode(); // printing the output System.out.println("Hashcode Value of " + value + " : " + output); } } Output: Hashcode Value of -30.0 : -1069678592 Comment More infoAdvertise with us Next Article Double hashCode() method in Java with examples S ShivamKD Follow Improve Article Tags : Java Java - util package Java-Functions Java-Double Practice Tags : Java Similar Reads Byte hashCode() method in Java with examples The hashCode() method of Byte class is a built in method in Java which is used to return the hash code of the ByteObject. Note: The hashCode() returns the same value as intValue(). Syntax ByteObject.hashCode() Return Value: It return an int value which represents the hashcode of the specified Byte o 2 min read Date hashCode() method in Java with Examples The hashCode() method of Java Date class returns a value which is a hash code for this object. Syntax: public int hashCode() Parameters: The function does not accept any parameter. Return Value: It returns a hashCode value for this object. Exception: The function does not throws any exception. Progr 2 min read Boolean hashCode() method in Java with examples The hashCode() method of Boolean class is a built in method to return a int hashcode value corresponding to the Boolean object. Syntax BooleanObject.hashCode() Return Type: It returns a int hashcode value corresponding to the Boolean object. It returns 1231 if the Boolean object stores the value tru 1 min read BitSet hashCode Method in Java with Examples The hashCode() Method of BitSet class in Java is used to fetch the hash code value of a particular this BitSet. This returned hash codes value depends on the set bits of the bit set being passed. Syntax: BitSet.hashCode() Parameters: The method does not accept any parameters. Return Value: The metho 2 min read Class hashCode() method in Java with Examples The hashCode() method of java.lang.Class class is used to get the hashCode representation of this entity. This method returns an integer value which is the hashCode. Syntax: public int hashCode() Parameter: This method does not accept any parameter. Return Value: This method returns an integer value 1 min read Like