- By setting up examples where a conditional will never execute, you can help students reason about the fact that conditionals only execute under certain conditions.
- For example, in the following Java code, if x<0, x cannot be >100, so the print statement is unreachable.
if (x < 0) {
if (x > 100) {
System.out.println("Ooops - we can never get here!");
}
}