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


Please Help Members By Posting Answers For Below Questions

Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword

1616


What do you understand by synchronization? Why is it important?

580


How do I find jre path in windows?

535


Hi we have an urgent requirement for Java/J2ee technical lead position & also looking for "Java Guidewire claimcentre" experienced professional for Bangalore location if interested can reach srisanh@gmail.com

2542


HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS

1584






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

620


who will give req's to u?. how they send req's to u? . what design documents contains?. when bugs raised on other developer code how to report to them?.(throgh mail or ........). how to retrive 100 recods from dao layer to presentation layer.using which collection?. what is sequence diagram.?.

1826


Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?

2569


What is the difference between comparable and comparator in java.util pkg?

602


What are the types of interface used in the java collections? : java collections

591


Hi Friends , am newbie to ajax. For example just consider one account registration - A form contains 8 text fields with submit button. In this form second texbox contains "username " . On right side of text box there is a label box . On clilck action i need to determine user is available or not. Is it possible on clicking label or should i click submit button.

1594


What is the use of hashcode in java ?

583


What is java collection? : java collections

590


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

580


What is the Spring2.5 MVC Navigation flow?

5383