0

I need help in Java Practice-58.2

Everything is the same as in initial code.However there is still an error.Please Help! import java.util.Scanner; import java.util.InputMismatchException; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); try { int num1 = scanner.nextInt(); int num2 = scanner.nextInt(); /* 1. Еrror: division by zero 2. Error: wrong value type */ //введите код сюда System.out.println(num1/num2); } catch(InputMismatchException ex){ System.out.println("Error: wrong value type"); } catch(ArithmeticException ex) { System.out.println("Error: division by zero"); } } }

20th May 2022, 3:16 AM
Ринат Альмяшев
Ринат Альмяшев - avatar
2 Answers
+ 2
Ринат Альмяшев Don't write this statement manually, just copy from description and paste in your code and you are done. Не пишите это заявление вручную, просто скопируйте из описания и вставьте в свой код, и все готово. Еrror: division by zero
20th May 2022, 3:24 AM
A͢J
A͢J - avatar
+ 1
Thank you man!
20th May 2022, 3:56 AM
Ринат Альмяшев
Ринат Альмяшев - avatar