Menu
Topics Index
...
`

Checked and Unchecked Exceptions


If you need explanation Read this topic

If you need Answer Take test on this topic

Checked and Unchecked Exceptions
Which of the following is/are incorrect?
1. class New1Exception extends Exception { } // this will create Checked Exception
2. class NewException extends IOExcpetion { } // this will create Checked Exception
3. class NewException extends NullPonterExcpetion { } // this will create Unchecked Exception

A. 1 only
B. 2 only
C. 3 only
D. 1 and 2
E. 2 and 3
F. All of them are correct
Topic: Exception Handling Syntax In Java Programming

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

Ans is F  here we have the concept of the Exceptions which are runtime error which cause the abnormal termination of the program, in the exceptions we have the 2 types, checked and unchecked, checked exceptions which are checked by the compiler if we are not going to handle than compile time error will raise(IOException,InterruptedException), unchecked exceptionx which wont checked by the compiler even though if we are not handling compiler wont give any error(NumberFormatException,NullPointerException) so here in the 1 case class extending the Exception class which is an Checked Exception so Child class also willl be the Checked Exception in case2 it is Extending the IOException which is Checked exception so Child class also willl be the Checked Exception in case 3 it is Extending the NullPointerException which is unchecked so Child class also willl be the UnChecked Exception

Posted by Uday Kumar    2015-03-11 01:43:08


This dose is now closed and the winners are Uday Kumar,  for 'First Correct Comment' and Uday Kumar for the 'Popular Comment'. The 'lucky liker' is Robi Parvez. Please login into Merit Campus using facebook, to claim your recharge. Go to http://java.meritcampus.com/earnings to raise the recharge.

Posted by Merit Campus    2015-03-12 01:39:25


© meritcampus 2019

All Rights Reserved.

Open In App