Skip to content

Latest commit

 

History

History
20 lines (19 loc) · 1.04 KB

Exception-Handling.md

File metadata and controls

20 lines (19 loc) · 1.04 KB

Exception Handling

  1. Why is exception handling important?
  2. What design pattern is used to implement exception handling features in most languages?
  3. What is the need for finally block?
  4. In what scenarios is code in finally not executed?
  5. Will finally be executed in the program below?
  6. Is try without a catch is allowed?
  7. Is try without catch and finally allowed?
  8. Can you explain the hierarchy of exception handling classes?
  9. What is the difference between error and exception?
  10. What is the difference between checked exceptions and unchecked exceptions?
  11. How do you throw an exception from a method?
  12. What happens when you throw a checked exception from a method?
  13. What are the options you have to eliminate compilation errors when handling checked exceptions?
  14. How do you create a custom exception?
  15. How do you handle multiple exception types with same exception handling block?
  16. Can you explain about try with resources?
  17. How does try with resources work?
  18. Can you explain a few exception handling best practices?