Код: Выделить всё
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
YearMonth yr = YearMonth.of(24, 12);
System.out.println(yr.atEndOfMonth().format(DateTimeFormatter.ofPattern("MMYY")));
Подробнее здесь: https://stackoverflow.com/questions/790 ... -a-24-year
Мобильная версия