Question: Scanner input = new Scanner ( System . in ) ; int numerator, denominator, result; try { System.out.print ( Enter numerator > >
Scanner input new ScannerSystemin;
int numerator, denominator, result;
try
System.out.printEnter numerator ;
numerator input.nextInt;
System.out.printEnter denominator ;
denominator input.nextInt;
result numerator denominator;
catchException mistake
System.out.printlnmistakegetMessage;
catchArithmeticException mistake
System.out.printlnmistakegetMessage;
catchInputMismatchException mistake
System.out.printlnWrong data type";
System.out.printlnEnd of program";
If the user enters as the denominator, the division statement throws an exception. Which of these exceptions will be executed?
a ArithmeticException
b InputMismatchException
c Exception
d exception java.lang.ArithmeticException has already been caught
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
