Step 4 of 6
else
else adds a second block that runs when the condition is false. Exactly one of the two blocks runs, never both, never neither:
int balance = -4;
if (balance >= 0) {
System.out.println("Balance OK");
} else {
System.out.println("Overdrawn");
}
Overdrawnelse has no condition of its own: it simply catches every case the if didn't. The } else { line closes the first block and opens the second, so it lines up with the if.