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 are the types of interface used in the java collections? : java collections

0 Answers  


what is the difference between checked and unchecked Exceptions?

4 Answers   CTS,


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

1 Answers   HCL,


what are advantages of HQL? what are advantages of Native SQL? what are advantages of Criteria API?

1 Answers   TCS,


what is class/object diagram

3 Answers   Zycus Infotech,






Can any one tell me How to explain bank project desription in interview

3 Answers   Infosys, Wipro,


VSS Objectives

1 Answers  


What is the use of the list interface in the java collection? : java collections

0 Answers  


In HashSet duplicates are allowed while adding to the HashSet, but while retreiving the object from HashSet is not shown the duplicate values, WHY ?

2 Answers   Cap Gemini,


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

0 Answers  


what about web architecture?

1 Answers   HCL,


which book is the best for preparing for SCWCD 1.5

4 Answers   Google,


Categories