Код: Выделить всё
public class ExceptionHandling {
public static void main(String[] args) throws InputMismatchException{
Scanner sc = new Scanner(System.in);
int a = 0;
int b = 0;
try {
a = sc.nextInt();
b = sc.nextInt();
try {
int c = a / b;
System.out.println(b);
} catch (ArithmeticException e) {
System.out.println(e);
}
} catch (InputMismatchException e) {
System.out.println(e);
}
}
}
Но когда я передавая 2147483648 в качестве входных данных, он дает java.util.InputMismatchException: Для входной строки: "2147483648" в качестве выходных данных.
Так может ли кто-нибудь сказать мне, почему я получаю For входная строка: "2147483648" в этом случае?
Подробнее здесь: https://stackoverflow.com/questions/656 ... 2147483648
Мобильная версия