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

Computer Science & Information Technology

You might also like to view...

An array whose number of elements changes while an application is running is referred to as a(n) ____ array.

A. dynamic B. updating C. active D. renewing

Computer Science & Information Technology

Link aggregation allows you to combine two or more data paths, or links, into one higher-speed link.?

Answer the following statement true (T) or false (F)

Computer Science & Information Technology