Identify the correct examples of Exception
Divide by zero error
Accessing the elements of an array beyond its range
Invalid input
Opening an empty file
Hard disk crash
Identify the true statements.
Checked exceptions must be explicitly caught or propagated(declared Thrown)
Unchecked exceptions must be explicitly caught or propagated(declared Thrown)
Checked exceptions in Java extend the java.lang.Exception class
Unchecked exceptions extend the java.lang.RuntimeException class
By convention, all exception-class names should end with the word Exception
True
False
Java guarantees that a finally clause (if one is present) will execute even if a try block exits by using a return, break or continue statement.
From which problems is it possible for a program to recover?
Errors
Exceptions
Both errors and exceptions
Neither
Is a program required to catch all exceptions that might happen?
No. You can write a program to catch just the exceptions you want.
No. But if a program catches one type of exception it must catch all other types as well.
Yes. If a program is not written to catch all exceptions it will not compile.
Yes. A program can not do I/O unless it catches all exceptions.
Class Exception is the superclass of all exceptions
Java throws ------------------- when division by zero in integer arithmetic occurs
an IntegerArithmeticException
an ArithmeticException
a DivideByZeroException
a NumberFormatException
A try block must always be followed by one or more catch blocks
If a catch handler is written to catch exception objects of a superclass type, it can also catch all objects of that class's subclasses.