OffsetTime hashCode() in Java with examples Last Updated : 11 Dec, 2018 Comments Improve Suggest changes Like Article Like Report The hashCode() method of OffsetTime class in Java is used to get a hash code for this Time instance. Syntax : public int hashCode() Parameter: This method accepts does not accepts any parameters. Return Value: It returns the a suitable hash code. Below programs illustrate the hashCode() method: Program 1 : Java // Java program to demonstrate the hashCode() method import java.time.OffsetTime; public class GFG { public static void main(String[] args) { // Parses the time OffsetTime time = OffsetTime.parse("15:10:30+07:00"); // gets the hash-code in time System.out.println("hash-code: " + time.hashCode()); } } Output: hash-code: -1984024609 Program 2 : Java // Java program to demonstrate the hashCode() method import java.time.OffsetTime; public class GFG { public static void main(String[] args) { // Parses the time OffsetTime time = OffsetTime.parse("11:30:30+06:00"); // gets the hash-code in time System.out.println("hash-code: " + time.hashCode()); } } Output: hash-code: 745450958 Reference: https://docs.oracle.com/javase/8/docs/api/java/time/OffsetTime.html#hashCode-- Comment More infoAdvertise with us Next Article OffsetTime hashCode() in Java with examples G gopaldave Follow Improve Article Tags : Java Java-Functions Java-time package Java-OffsetTime Practice Tags : Java Similar Reads OffsetDateTime hashCode() method in Java with examples The hashCode() method of OffsetDateTime class in Java is used to get a hash code for this date-time instance. Syntax : public int hashCode() Parameter : This method accepts does not accepts any parameter. Return Value: It returns a suitable hash code. Below programs illustrate the hashCode() method: 1 min read List hashCode() Method in Java with Examples This method is used to generate the hashCode for the given list. Implementation:Java// Java code to show the implementation of // hashCode method in list interface import java.util.*; public class Main { public static void main(String[] args) { // Initializing a list List<Integer> l = new Arra 2 min read LocalTime hashCode() method in Java with Examples The hashCode() method of a LocalTime class is used to return hashCode for this time. 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. It can be used to perform some operation on hashing related algorithm like has 2 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 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 Like