Is it possible to create Userdefined Unchecked Exception
also?If Yes, give an example?
Answer Posted / 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 View All Answers
What are the types of interface used in the java collections? : java collections
Hi frnds how to lock an user when he enter wrong credentials more than 3 time using java or j2ee tech take username and password in a bean no need to connect DB and validate give me some sample application code or links its urgent for me thanks in advance
What are maps interfaces in the java collections? : java collections
my interviewer asked me what technical specification you used how to answer that question
How is hashset maintained in memory by java ?
What are the types of the main implementing classes in the map interfaces? : java collections
What are the different types of ways where you can iterate over a list? : java collections
Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?
What are the different types of features of the java collections framework? : java collections
What is the enumerator of the java collection framework? : java collections
What is the Spring2.5 MVC Navigation flow?
What are the different types of classes implemented in the set interfaces? : java collections
Which interface does java.util.hashtable implement?
What are the differences between the java collection and the java list? : java collections
What are the classes in the java collection framework? : java collections