/* package whatever; // don't place package name! */
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.IsoFields;
import java.time.temporal.TemporalAdjusters;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
static DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("dd-MM-uu");
public static void main
(String[] args
) {
LocalDate date = LocalDate.parse(str, dateFormatter);
// Is date the end of a quarter?
if (date.get(IsoFields.DAY_OF_QUARTER) >= 90
&& date.equals(date.with(TemporalAdjusters.lastDayOfMonth()))) {
LocalDate endOfNextQuarter = date.plus(1, IsoFields.QUARTER_YEARS)
.with(TemporalAdjusters.lastDayOfMonth());
System.
out.
println("End of next quarter is: " + endOfNextQuarter
); System.
out.
println("End of next quarter is: " + endOfNextQuarter.format(dateFormatter));
} else {
}
}
}