Details of this Paper

CMIS 242 Intermediate Programming homework 3




Instructions;What RuntimeException, if any, will the following program throw? class Exception1;public static void main(String[] args);int x = 1/0;How can you tell whether an exception is checked or unchecked? What is required of checked exceptions that is not required of those that are unchecked?;What is the output of the following program? class Exception2;public static void main(String[] args);try;aMethod();System.out.println("After the call");catch (ArithmeticException exception);System.out.println("Arithmetic Exception");catch (RuntimeException exception);System.out.println("Runtime Exception");System.out.println("After the try-catch statement");private static void aMethod() throws RuntimeException;int x = 1/0;What will happen if the order of the catch blocks is reversed?;Why won't the following program compile? class Exception3;public static void main(String[] args);if (Integer.parseInt(args[0]) == 0);throw new Exception("Invalid Command Line Argument");Correct it so it will compile.;Explain the difference between the keywords throw and throws. When is each used?


Paper#67643 | Written in 18-Jul-2015

Price : $22