JapaneseChronology prolepticYear() method in Java with Example
The prolepticYear() method of java.time.chrono.JapaneseChronology class is used to retrieve the proleptic year present in the Japanese system of particular Japanese era.
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.
public int prolepticYear(Era era, int yearOfEra)
Parameter: This method takes the following argument as a parameter.
- era: which is the object of Japanese Era.
- yearofEra: which is the year for the particular Japanese era
Return Value: This method returns the proleptic year present in the Japaneseh system of particular Japanese era.
Below are the examples to illustrate the prolepticYear() method:
proleptic Year is: 3432
passed parameter can not form a date Exception thrown: java.time.DateTimeException: Invalid yearOfEra value