22
Answer (Choose 1 answer)
A. Compilation succeeds. The import on line 1 is necessary. During execution, an exception is thrown at line 3
B. Compilation fails at line 3
C. Compilation fails at line 2.
D. Compilation succeeds and no exception is thrown during execution.
E. Compilation succeeds, although the import on line 1 is not necessary. During execution, an exception is thrown at line 3
Which one statement is true about the following code fragment?
1. import java.lang.Math;
2. Math myMath = new Math();
3. System.out.println("cosine of 0.123 = " + myMath.cos(0.123));