| |
IO-Exception Handling 1) Read the code below carefully. import java.io.*; public class OutOut System.out = pr; System.out.println("Lets see
what I see now??");
2) Is the following code legal? 1. try {2. 3. } finally {4. 5. }
3)What exception types can be caught by the following handler? 6. catch (Exception e) {7. 8. }-----------All Type of Exception it will handle
What is wrong with using this type of exception handler? 4) Is there anything wrong with the following exception handler as written? Will this code compile? 9. try {10. 11.} catch (Exception e) {12. 13.} catch (ArithmeticException a) {14. 15.}5)Match each situation in the first list with an item in the second list.
1__error 2_checked exception 3__compile error 4__no exception 6) What is an Error (as opposed to an Exception)? 7) What is the difference between a checked and unchecked exception?
Ans-Checked are IOException are checked Exception
Unchecked Exception- Error and Runtime Exception Not necessary to specify in the clause.
Q8)
|