The program tests each condition from top to bottom until it finds a true one. I'll show you how this order affects which block runs. Once a condition is true, its block executes and the entire chain stops.
All remaining conditions are skipped, even if they would also be true. You'll see that if (x > 5) { } else if (x > 3) { } never reaches the second condition when x is 6, because the first condition already matched.