The then-branch or the else-branch of an if-else statement can be any Java statement, and in particular it can be a block.
Example: Given month and year, compute month and year of the next month.
int month, year, nextMonth, nextYear; ... if (month == 12) { nextMonth = 1; nextYear = year + 1; } else { nextMonth = month + 1; nextYear = year; }