- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
try {
System.out.print("x=");
x = Integer.parseInt(br.readLine());
} catch (IOException ex) {
System.err.println("Ошибка. Рожей не вышел.");
} catch(NumberFormatException e) {
System.err.println("Ошибка. Неправильный формат аргумента.");
}
run:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - unreported exception java.io.IOException; must be caught or declared to be thrown
at pack.main(bydlokod.java:25)
BUILD SUCCESSFUL (total time: 0 seconds)
(только что попробовал)