Is it possible to create Userdefined Unchecked Exception
also?If Yes, give an example?



Is it possible to create Userdefined Unchecked Exception also?If Yes, give an example?..

Answer / chinna

Yes,

public class UnCheckedExceptionExam extends RuntimeException
{

public UnCheckedExceptionExam(){
System.out.println("No argument");
}
public UnCheckedExceptionExam(String message){
System.out.println(message);
System.out.println(initCause(new Throwable("define
exception")));
}
public UnCheckedExceptionExam(Throwable cause){
System.out.println(cause.getCause());
}
public UnCheckedExceptionExam(String message,Throwable
cause){
System.out.println(message);
System.out.println(cause.getCause());

}
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Java J2EE AllOther Interview Questions

What is Visual Source Safe(source control Tool)?

1 Answers  


what is difference between vector and arraylist?.

4 Answers   C DAC, HCL,


Which interface does java.util.hashtable implement?

0 Answers  


What are the different types of features of the java collections framework? : java collections

0 Answers  


In hyderabad, which s/w training center is best for java, other than corejava what r the new tools to learn in java,which tool is best & have current requirement,pls give me information about java to learn ?

0 Answers  






What is deque in the java collections framework? : java collections

0 Answers  


what are callback methods?

3 Answers   iFlex,


What are the classes in the java collection framework? : java collections

0 Answers  


what about web architecture?

1 Answers   HCL,


where is JNDI being used in java platform?

2 Answers  


when exactly should we use throws ,and wen exactly should we use the try and catch for exceptional handling

0 Answers  


What are the different types of classes implemented in the set interfaces? : java collections

0 Answers  


Categories