Given the code fragment:
What is the result?
A.
Reading Card
Checking Card
B.
Compilation fails only at line n1.
C.
Compilation fails only at line n2.
D.
Compilation fails only at line n3.
E.
Compilation fails at both line n2 and line n3.
Given the code fragment:
What is the result?
A.
Reading Card
Checking Card
B.
Compilation fails only at line n1.
C.
Compilation fails only at line n2.
D.
Compilation fails only at line n3.
E.
Compilation fails at both line n2 and line n3.
Test E.
D is correct as RuntimeException need not be caught
tested D.
D
Answer: D
Exception must be caught because it is a checked exception.