Year isLeap() method in Java with Examples Last Updated : 27 Nov, 2018 Comments Improve Suggest changes Like Article Like Report The isLeap() method of Year class in Java is used to check if this Year object is a leap year or not according to the proleptic calendar system rules. A year is a leap year if it has 366 days in it. According to the proleptic calendar system rules, a year is a Leap year if: If it is divisible by 4. It is not divisible by 100 but it can be divisible by 400. Syntax: public boolean isLeap() Parameter: This method does not accepts any parameter. Return Value: It returns a boolean True value if this Year object's value is a leap year according to the proleptic calendar system rules, otherwise it returns False. Below programs illustrate the isLeap() method of Year in Java: Program 1: Java // Program to illustrate the isLeap() method import java.util.*; import java.time.*; public class GfG { public static void main(String[] args) { // Create first Year object Year firstYear = Year.of(2016); // Check if this year object's value is // a leap year or not System.out.println(firstYear.isLeap()); } } Output: true Program 2: Java // Program to illustrate the isLeap() method import java.util.*; import java.time.*; public class GfG { public static void main(String[] args) { // Create first Year object Year firstYear = Year.of(1990); // Check if this year object's value is // a leap year or not System.out.println(firstYear.isLeap()); } } Output: false Reference: https://docs.oracle.com/javase/8/docs/api/java/time/Year.html#isLeap-- Comment More infoAdvertise with us Next Article Year isLeap() method in Java with Examples B barykrg Follow Improve Article Tags : Misc Java Java-Functions Java-time package Java-Year +1 More Practice Tags : JavaMisc Similar Reads Year isAfter() method in Java with Examples The isAfter() method of Year class in Java is used to check if this current Year object is after the Year specified as parameter to this method. Syntax: public boolean isAfter(Year otherYear) Parameter: It accepts a single parameter otherYear with which the current Year object is to be compared. Ret 2 min read Year isBefore() method in Java with Examples The isBefore() method of Year class in Java is used to check if this current Year object is before the Year specified as parameter to this method. Syntax: public boolean isBefore(Year otherYear) Parameter: It accepts a single parameter otherYear with which the current Year object is to be compared. 2 min read YearMonth isLeapYear() method in Java with Examples The isLeapYear() method of YearMonth class in Java is used to check if the year in this YearMonth object is a leap year or not. According to the proleptic calendar system rules, a year is a Leap year if: If it is divisible by 4. It is not divisible by 100 but it can be divisible by 400. Syntax: publ 2 min read Year of() method in Java with Examples The of() method of Year class in Java is used to return an Year instance. It accepts an year according to the proleptic ISO calendar system and returns an instance of Year with the specified isoYear. Syntax: public static Year of(int isoYear) Parameter: It accepts a single integral value isoYear as 1 min read Year get() method in Java with Examples get() method of the Year class used to get the value for the specified field passed as parameter from this Year as an integer value. This method queries this year for the value of the field and the returned value will always be within the valid range of values for the field. When the field is not su 2 min read Like