views:

246

answers:

2

How do you find the number of days in a month in Java?

A: 

Looks like homework. Lookup Calendar.

Thomas Pornin
+5  A: 

Set the year and month on a Calendar object and then use getActualMaximum to return the last day:

calendar.getActualMaximum(calendar.DAY_OF_MONTH) 
Mark Byers
Thank you for responding.I accept you solution and that perfectly work
chetan