Java Exception Handling Question and Answers
13. | When Arithmetic Exception is thrown? |
---|---|
The Arithmetic Exception is thrown when integer is divided by zero or taking the remainder of a number by zero. It is never thrown in floating point operations. | |
14. | What classes of exceptions may be caught by a catch clause? |
---|---|
|
|
15. | When is finally block NOT called? |
---|---|
|
|
16. | What is difference between throw and throws keyword in Java? |
---|---|
throws keyword is used with method signature to declare the exceptions that the method might throw whereas throw keyword is used to disrupts the flow of program and handing over the exception object to runtime to handle it. | |