What things should be kept in mind while creating your own exceptions in Java?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. What things should be kept in mind while creating your own exceptions in Java?Core Java
Ans. All exceptions must be a child of Throwable.

If you want to write a checked exception that is automatically enforced by the Handle or Declare Rule, you need to extend the Exception class.

You want to write a runtime exception, you need to extend the RuntimeException class.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   exceptions   exception handling   user defined exceptions   throwable   architecture   library development   technical architect   technical lead


Related Questions

  What are the benefits of using Spring Framework ?
  What are various types of Class loaders used by JVM ?
  Difference between SAX and DOM Parser ?
  Difference between C++ and Java ?
  Different types of memory used by JVM ?
  How substring() method of String class create memory leaks?
  What are LDAP servers used for ?
  What is the best practice configuration usage for files - pom.xml or settings.xml ?
  Why Web services use HTTP as the communication protocol ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: