This is from Sun Certified Programmer for
Java 6 Study Guide, Page 320,
And the command-line invocation:
java Fork live2
What is the result?
A.
test case
B. production live2
C. test case live2
D. Compilation fails
E. An exception is thrown at runtime
Answer:
E is correct. Because the short circuit (||) is not used, both operands are evaluated. Since args[1] is past the args array bounds, an ArrayIndexOutOfBoundsException is thrown. A, B, C, and D are incorrect based on the above. (Objective 7.6)
Why isn't args[1] = live2? therefore not outofbounds?