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
Correct Answer:
Verified
Q21: The JList GUI component generates events that
Q23: If you have created an exception class,
Q24: For interfaces such as WindowListener that contain
Q25: import java.util.*;
Public class ExceptionExample1
{
Static Scanner console =
Q26: import java.util.*;
Public class ExceptionExample1
{
Static Scanner console =
Q28: How many finally blocks can there be
Q31: Which of the following statements is true?
A)
Q35: Which of the following exceptions might be
Q36: To handle window events, you first create
Q38: If a negative value is used for
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents