How to get daysofmonth of a year in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

How to get daysofmonth of a year in java?

When particular year is give it has to retrieve lenght of each month i.e., days

3rd Jul 2021, 9:47 PM
Chaitanya Krishna
Chaitanya Krishna - avatar
1 Answer
+ 3
Nikolay Baka rules for leap years (29 days in february) is quite more complex than just 'divisible by 4': must be divisible by 4 except for end-of-century years, which must be divisible by 400 (2000 is a leap year but not 1900) ;P
4th Jul 2021, 3:57 PM
visph
visph - avatar