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.
public static Year of(int isoYear)
Parameter: It accepts a single integral value isoYear as the only parameter according to the proleptic ISO calendar system.
Return Value: It returns an instance of Year.
Exception: It throws DateTimeException if the year passed as argument is found to be invalid according to the proleptic ISO calendar system.
Below programs illustrate the length() method of Year in Java:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.