Which one of the following code examples uses valid Java syntax?
Correct Answer: C
Question 168
Given: And given the code fragment: What is the result?
Correct Answer: C
Question 169
Which two class definitions fail to compile? (Choose two.)
Correct Answer: A,D
Question 170
Given: Which two actions, used independently, will permit this class to compile?
Correct Answer: C,D
The IOException must be caught or be declared to be thrown. We must add a throws exception to the doSomething () method signature (static void doSomething() throws IOException). Then we can either add the same throws IOException to the main method (public static void main (String[] args) throws IOException), or change the catch statement in main to IOException.