Vidyalelo
Java Programming · Q32

Input Output

Programming · Java Programming · question 32

Q32

try File f = new File("a.txt"); catch(Exception e) catch(IOException io) Is this code create new file name a.txt ?

A.
true
B.
false
C.
Compilation Error
Answer
D.
None of these

Answer: Option C

Solution

Answer: Option C
Solution:

IOException is unreachable to compiler because all exception are going to catch up by Exception block.