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
HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS
What is iterator in the java collections framework? : java collections
What is deque in the java collections framework? : java collections
What is the use of hashcode in java ?
What are maps interfaces in the java collections? : java collections
Which sorting algorithm is used by collections.sort() in java ?
What is the use of the list interface in the java collection? : java collections
What are the interfaces in java collections? : java collections
What are the uses of the set interfaces in the java collections? : java collections
What are the considerations to be made in case of loops in java ?
What are the types of interface used in the java collections? : java collections
What are the main classes of the list interfaces? : java collections
What are the different types of classes implemented in the set interfaces? : java collections
What are the types of the main implementing classes in the map interfaces? : java collections
What are the queues in the java collection framework? : java collections