Tag: exceptions

Exception Interview Questions

Java Interview - Exceptions 5 minutes read Exceptions List questions: What are Checked and Unchecked Exception? What are runtime exceptions? What is the difference between error and an exception? How to create custom exceptions? If I want an object of my class to be thrown as an exception object, what should I do? If my class already extends from some other class what should I do if I want an instance of my class to be thrown as an exception object? How does an exception permeate through the code? What are the different ways to handle exceptions? What is the basic difference between the 2 approaches to exception handling…1> try catch block and 2> specifying the candidate exceptions in the throws clause? When should you use which approach?