java - How to check whether date is valid -
java - How to check whether date is valid -
i can utilize parseint , if-else-statements , i'm stuck right now. understood logic, can't command illustration feb dates , jump years. wrote statements it.
boolean jump = false; if (((year % 4) == 0) && ((year % 100) == 0) && ((year % 400) == 0) && ((year % 4000) != 0)) jump = true; else jump = false; but can't contact february. can help me please?
leap year can evaluated by:
if ((year % 4 == 0) && (year % 100 != 0)) { jump = true; } else if (year % 400 == 0) { jump = true; } else { jump = false; } java date
Comments
Post a Comment