What output will be produced by the following code? The definition of the class Negative Number Exception is given in the preceding material, but you do not need to look at it to answer this question.
try
{
int n = 7;
if (n > 0)
throw new Exception();
else if (n
throw new NegativeNumberException();
else
System.out.println("Hello!");
}
catch(NegativeNumberException e)
System.out.println("First catch.");
catch(Exception e)
System.out.println("Second catch");
System.out.println("End of code");
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here