It is better to use the new Java 8 date time functions here:
LocalDate date = LocalDate.of(2000, Month.OCTOBER, 15);
LocalDate lastOfMonth = date.with(TemporalAdjusters.lastDayOfMonth());
System.out.printf("last day of Month: %s%n", lastOfMonth );
Yes, theoretically you could also use Calendar objects and do all kinds of low-level operations yourself. But there is a possibility: you will get it wrong ... well, if you do not look here and follow the advice from there.
: 310 java.time( , ); 310 "" Java7. , , , : , "" .