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

Which interface does java.util.hashtable implement?

0 Answers  


What are the different types of ways where you can iterate over a list? : java collections

0 Answers  


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

0 Answers  


Why do you use Context Object

2 Answers   HCL,


Should we create system software ( e.g operating system ) in java ?

0 Answers  


How to use ANT?

2 Answers  


What is the difference between Eclipse and MyEclipse?

7 Answers   IBM, Wavex,


What is difference between Application Server and Web Server?

1 Answers   Logica CMG, SCS,


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

0 Answers  


What are the uses of the set interfaces in the java collections? : java collections

0 Answers  


How to implement or use the singleton class in java?

3 Answers  


What are the types of the main implementing classes in the map interfaces? : java collections

0 Answers  


Categories