ZoneOffsetTransitionRule hashCode() method in Java with Example Last Updated : 29 May, 2020 Comments Improve Suggest changes Like Article Like Report The hashCode() method of java.time.zone.ZoneOffsetTransitionRule class is used to get the hash code of this zone offset transition rule object. Syntax: public int hashCode() Parameter: this method does not accept any parameter. Return Value: This method returns the hash code of this zone offset transition rule object. Below are the examples to illustrate the hashCode() method: Example 1: Java // Java program to demonstrate // hashCode() method import java.util.*; import java.io.*; import java.time.*; import java.time.chrono.*; import java.time.zone.*; public class GFG { public static void main(String[] argv) { // creating and initializing // ZoneOffsetTransitionRule Object ZoneOffsetTransitionRule zonetrans1 = ZoneOffsetTransitionRule .of( Month.JANUARY, 12, DayOfWeek.SUNDAY, LocalTime.of(03, 24, 45), false, ZoneOffsetTransitionRule .TimeDefinition .STANDARD, ZoneOffset.ofTotalSeconds(8), ZoneOffset.ofTotalSeconds(17), ZoneOffset.ofTotalSeconds(12)); // getting the hash code // by using hashCode() method int hash = zonetrans1.hashCode(); // display the result System.out.println("hash code : " + hash); } } Output: hash code : 402556303 Example 2: Java // Java program to demonstrate // hashCode() method import java.util.*; import java.io.*; import java.time.*; import java.time.chrono.*; import java.time.zone.*; public class GFG { public static void main(String[] argv) { // creating and initializing // ZoneOffsetTransitionRule Object ZoneOffsetTransitionRule zonetrans1 = ZoneOffsetTransitionRule .of( Month.JANUARY, 12, DayOfWeek.SUNDAY, LocalTime.of(06, 24, 45), false, ZoneOffsetTransitionRule .TimeDefinition .STANDARD, ZoneOffset.ofTotalSeconds(8), ZoneOffset.ofTotalSeconds(17), ZoneOffset.ofTotalSeconds(12)); // getting the hash code // by using hashCode() method int hash = zonetrans1.hashCode(); // display the result System.out.println("hash code : " + hash); } } Output: hash code : 756450703 Reference: https://docs.oracle.com/javase/9/docs/api/java/time/zone/ZoneOffsetTransitionRule.html#hashCode-- Comment More infoAdvertise with us Next Article ZoneOffsetTransitionRule hashCode() method in Java with Example R rohitprasad3 Follow Improve Article Tags : Java Java-Functions Practice Tags : Java Similar Reads ZoneOffsetTransition hashCode() method in Java with Example The hashCode() method of java.time.zone.ZoneOffsetTransition class is used to get the hash code for the zone offset transition object. Syntax: public int hashCode() Parameter: This method does not accept any parameter. Return Value: This method returns the hash code for the zone offset transition ob 2 min read 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 ZoneId hashCode() method in Java with Examples 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() metho 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 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 Like