If you mean code like the following, then yes, if x < 5 is true, then execute its body to output an A and skip the rest. So x = 2 outputs A.
if (x < 5){
System.out.print("A");
} else if (x < 10){
System.out.print("B");
} else {
System.out.print("C");
}
If you mean code like the following,
if (x < 5){
System.out.print("A");
} else {
System.out.print("B");
}
if (x < 10){
System.out.print("C");
} else {
System.out.print("D");
}
if (x < 20){
System.out.print("E");
} else {
System.out.print("F");
}
In this case, any value of x will ouput 3 letters because each if...else would output a letter.
If x = 2, output is ACE. if x = 8, ouput is BCE. If x = 21, output is BDF.