Q. 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
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) Compilation Error
Explanation: IOException is unreachable to compiler because all exception is going to catch by Exception block.
Explanation by: Kiran Rapria
IOException is unreachable to compiler because all exception is going to catch by Exception block.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
91
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Kiran Rapria
Publisher
πŸ“ˆ
90%
Success Rate