This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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 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 = live2? therefore not outofbounds?