import java.util.*;public class ExceptionExample1{ static Scanner console = new Scanner(System.in); public static void main(String[] args) { int dividend, divisor, quotient; try { System.out.print("Enter dividend: "); dividend = console.nextInt(); System.out.println(); System.out.print("Enter divisor: "); divisor = console.nextInt(); System.out.println(); quotient = dividend / divisor; System.out.println("quotient = " + quotient); } catch (ArithmeticException aeRef) {
System.out.println("Exception" + aeRef.toString()); } catch (InputMismatchException imeRef) { System.out.println("Exception " + imeRef.toString()); } catch( IOException ioeRef) { System.out.println("Exception " + ioeRef.toString()); } }}Which method throws the second exception in the code in the accompanying figure?
A. nextInt
B. toString
C. println
D. nextLine
Answer: A
You might also like to view...
To create a chart, you select the cells that contain the data you want to chart in a worksheet, then use commands in the Insert Chart group on the Charts tab to specify the chart type you want to add.
Answer the following statement true (T) or false (F)
In a systems development life cycle (SDLC) model, the purpose of the _____ is to create a physical model that will satisfy all documented requirements for the system.?
A. ?systems implementation phase B. ?systems planning phase C. ?systems analysis phase D. ?systems design phase
Sheet 1 and Sheet 2 are grouped. If you enter a formula in B3 of Sheet 1, what happens in Sheet 2?
A. No change happens. B. Sheet 2 B3 has the same formula. C. A warning appears, warning you not to make changes in grouped sheets. D. Formatting will change on Sheet 2, but not formulas.
You can merge more than two files.
Answer the following statement true (T) or false (F)