ValueRange hashCode() method in Java with Examples Last Updated : 29 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The hashCode() method of ValueRange class is used to get the hashCode value for this ValueRange. It returns an integer value which is the hashCode value for this instance of the ValueRange. Syntax: public int hashCode() Parameters: This method accepts nothing. Return value: This method returns a suitable hash code. Below programs illustrate the ValueRange.hashCode() method: Program 1: Java // Java program to demonstrate // ValueRange.hashCode() method import java.time.LocalDateTime; import java.time.temporal.ChronoField; import java.time.temporal.ValueRange; public class GFG { public static void main(String[] args) { // create LocalDateTime LocalDateTime l1 = LocalDateTime .parse("2018-02-06T19:21:12"); // Get ValueRange object ValueRange vR = l1.range(ChronoField.DAY_OF_MONTH); // apply hashCode() int code = vR.hashCode(); // print results System.out.println("hashCode: " + code); } } Output: hashCode: 1900573 Program 2: Java // Java program to demonstrate // ValueRange.hashCode() method import java.time.temporal.ValueRange; public class GFG { public static void main(String[] args) { // create ValueRange object ValueRange vRange = ValueRange.of(1111, 66666); // apply hashCode() int code = vRange.hashCode(); // print results System.out.println("hashCode: " + code); } } Output: hashCode: 3932210 References: https://docs.oracle.com/javase/10/docs/api/java/time/temporal/ValueRange.html#hashCode() Comment More infoAdvertise with us Next Article Path hashCode() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions java.time.temporal package Java-ValueRange Practice Tags : Java Similar Reads Package hashCode() method in Java with Examples The hashCode() method of java.lang.Package class is used to get the hashCode value of this package instance. The method returns the hashCode value as an integer value.Syntax: public int hashCode() Parameter: This method does not accepts any parameter.Return Value: This method returns the hashCode va 2 min read Package hashCode() method in Java with Examples The hashCode() method of java.lang.Package class is used to get the hashCode value of this package instance. The method returns the hashCode value as an integer value.Syntax: public int hashCode() Parameter: This method does not accepts any parameter.Return Value: This method returns the hashCode va 2 min read UUID hashCode() Method in Java with Examples The hashCode() method of UUID class in Java is generally used to get the hash code value of the UUID. Syntax: public int hashCode() Parameters: This method does not take any parameter. Return Value: This method returns an integer value which is the hashCode value for this UUID instance. Below progra 1 min read Path hashCode() method in Java with Examples The Java Path interface was added to Java NIO in Java 7. hashCode() method of java.nio.file.Path used to return a hash code for this path after computing hashcode. The hashcode is always the same if the object doesnât change. Hashcode is a unique code generated by the JVM at time of object creation. 2 min read NumberFormat hashCode() method in Java with Examples The hashCode() method is a built-in method of the java.text.NumberFormat returns a hash-code value for this given object of instance. Syntax: public int hashCode() Parameters: The function does not accepts any parameter. Return Value: The function returns the hash-code value. Below is the implementa 1 min read NumberFormat hashCode() method in Java with Examples The hashCode() method is a built-in method of the java.text.NumberFormat returns a hash-code value for this given object of instance. Syntax: public int hashCode() Parameters: The function does not accepts any parameter. Return Value: The function returns the hash-code value. Below is the implementa 1 min read Like