Exception handling with try-throw-catch-finally constructs MCQ Set-2

Errorlogger
0
1) PatternSyntaxException Class Methods is an unchecked exception that indicates a syntax error in a regular expression pattern?
A) True
B) False


2) Which is a superclass of all exception classes?
A) Throwable
B) Exception
C) RuntimeException
D) IOException


3) If we want to create our own exception class then we have to?
A) Use throw keyword
B) Use final keyword
C) Extend exception class
D) Use try and catch block


4) Which Exception occurs when a class is not found while dynamically loading a class using the class loaders?
A) ClassNotFoundException
B) ClassFoundException
C) NoClassDefFoundError
D) ClassDefFoundError


5) Which class is used when a program does not want to handle exception?
A) Throws
B) Try
C) Catch
D) Final


6) Which keyword is used for the block to handle the exceptions generated by try block?
A) Catch
B) Final
C) throw
D) try


7) The classes that extend Throwable class except RuntimeException and Error are known as?
A) Checked Exception
B) Unchecked Exception
C) Error
D) None of the above


8) Unchecked exceptions are checked at compile-time rather they are checked at runtime?
A) True
B) False


9) Which is irrecoverable?
A) Error
B) Checked Exception
C) Unchecked Exception
D) Both B & C


10) If you are inserting any value in the wrong index as shown below, it would result in
1. int a[]=new int[5];
2. a[10]=50;

A) NullPointerException
B) ArrayIndexOutOfBoundsException
C) ArithmeticException
D) NumberFormatException


Tags

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(30)

Our website uses cookies to enhance your experience. Check Now
Accept !