Does the vi include code Calendar java
-
Will the Calendar-type visocotic years be taken into account?
-
Class
Calendar
does not have a method for testing the visocon year.Such a method exists in sweat class: https://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#isLeapYear(int) :
public boolean isLeapYear(int year)
Determines if the given year is a leap year. Returns true if the given year is a leap year. To specify BC year numbers, 1 - year number must be given. For example, year BC 4 is specified as -3.
Parameters:year
- the given year.
Returns:true
if the given year is a leap year;false
otherwise.Note: Date classes
Calendar
/GregorianCalendar
/Date
are obsolete following the release of Java 8 in March 2014, where a new functionality was implemented https://docs.oracle.com/javase/8/docs/technotes/guides/datetime/index.html ♪