✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
In the Java VM specification, switch/case instructions can be compiled/encoded into bytecodes in two alternative ways.
In the following example of Java code, what would be the most appropriate way to compile/encode the switch/case instruction into bytecodes.
switch (x) {
case 999: return 1;
case 1000: return 0;
case 1001: return 1;
default: return -1;
}
(select the option that best fits the question).