Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| |||||||||||||||||||||||||||
Interview Questions and Answers for 'Headstrong' - 4 question(s) found - Order By Rating | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
Ans. A try block can be followed by one or more catch blocks. Each catch block must contain a different exception handler. So, if you have to perform different tasks at the occurrence of different exceptions, use java multi-catch block. | |||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||
![]() ![]() ![]() ![]() | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||
![]() ![]() ![]() ![]() | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
Ans. 1. Wrap the desired code in try block followed by a catch / finally to catch the exception 2. Declare the throws clause with exceptions that the code is expected to throw as an indication to the calling method to take care of it. | |||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||
![]() ![]() ![]() ![]() | |||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||
![]() | |||||||||||||||||||||||||||
![]() ![]() ![]() ![]() ![]() ![]() | |||||||||||||||||||||||||||