1. Can you derive an exception class from the predefined class IOException, or must it be derived from the class Exception? 2. What happens if you invoke a method and it throws a checked exception...


1. Can you derive an exception class from the predefined class IOException, or must it be derived from the class Exception?


2. What happens if you invoke a method and it throws a checked exception that it does not catch?


3.  Correct the following method definition by adding a suitable throws


clause:


public void doStuff(int n)


{


 if (n


 throw new Exception("Negative number.");


}


2


Nov 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here