ZoneId hashCode() method in Java with Examples Last Updated : 19 Jun, 2019 Comments Improve Suggest changes Like Article Like Report The hashCode() method of the ZoneId class in Java is used to return unique hashcode for this ZoneId. Syntax: public int hashCode(Object obj) Parameters: This method accepts nothing. Return value: This method returns an int which represents the hashCode. Below programs illustrate the hashCode() method: Program 1: Java // Java program to demonstrate // ZoneId.hashCode() method import java.time.*; public class GFG { public static void main(String[] args) { // create ZoneId object ZoneId zoneId = ZoneId.of("Europe/Paris"); // get and print hashcode System.out.println("hashcode: " + zoneId.hashCode()); } } Output: hashcode: -672549154 Program 2: Java // Java program to demonstrate // ZoneId.hashCode() method import java.time.*; public class GFG { public static void main(String[] args) { // create ZoneId object ZoneId zoneId = ZoneId.of("Asia/Calcutta"); // get and print hashcode System.out.println("hashcode: " + zoneId.hashCode()); } } Output: hashcode: -681304890 Reference: https://docs.oracle.com/javase/10/docs/api/java/time/ZoneId.html#hashCode() Comment More infoAdvertise with us Next Article ZoneId hashCode() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions Java-time package Java-ZoneId Practice Tags : Java Similar Reads ZoneOffset hashCode() method in Java with Examples The hashCode() method of ZoneOffset Class in java.time package is used to obtain hashCode value of this instance of ZoneOffset. This method does not takes any parameter and returns an int value. which is the hashCode value. Syntax: public static int hashCode() Parameters: This method accepts do not 1 min read ZonedDateTime hashCode() method in Java with Examples The hashCode() method of a ZonedDateTime class is used to get the hashcode for this ZonedDateTime. 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 hashtable, hashmap etc. An object can also be searc 1 min read Year hashCode() method in Java with Examples The hashCode() method of Year class in Java is used to get a suitable hash code for the current Year object. Syntax: public int hashCode() Parameter: This method does not accepts any parameter. Return Value: It returns a suitable integral hash code for the year object with which it is used. It never 1 min read Writer hashCode() method in Java with Example The hashCode() method of Writer Class in Java is used to get the HashCode value of this Writer instance. This method does not accepts any parameter and returns the required int value. Syntax: public int hashCode() Parameters: This method accepts does not accepts any parameter. Return Value: This met 2 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 Like