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
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here