Exceptions


  • What is an Exception?
  • What is differnece between Exception and Error?
  • What is the superclass of Exception?
  • Types of Exception?
  • What is checked and Unchecked Exceptions?
  • How exceptions are handled in Java?
  • What is finally block?
  • Is there a condition in which finally block will not execute?
  • Output of below code:

      public int getInt() {
int a = 1;
try {
if (a == 1)
throw new Exception();
return 10;
} catch (Exception e) {
return 20;
} finally {
return 30;
         }
      }

No comments:

Post a Comment