How do you find the number of days in a month in Java?
Set the year and month on a Calendar object and then use getActualMaximum to return the last day:
getActualMaximum
calendar.getActualMaximum(Calendar.DAY_OF_MONTH)
2.1m questions
2.1m answers
60 comments
57.0k users