Question: 7 Consider class hierarchy and code fragments: the following java.lang.Exception java o. IOException java. io. StreamCorruptedException java.net. MalformedURLException 1. try 2. URL u new URL





7 Consider class hierarchy and code fragments: the following java.lang.Exception java o. IOException java. io. StreamCorruptedException java.net. MalformedURLException 1. try 2. URL u new URL (s); assume s is previously defined 3. Object o in. readobject(); in is an 0bjectInputStream 4. System. out.println("Success"); 5. 6. catch (Mal formed URLException e) 7. System.out.printlnC" Bad URL"); 8. 9. catch (StreamCorruptedException e) 10 System.out.print Inc Bad file contents 12. catch (Exception e) 13 System. out.printinC "General exception") 14. 15. finally 16 System out.printlnC doing finally part 18. System out.printlnC" Carrying on")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
