16 lines
284 B
Java
16 lines
284 B
Java
public class Capture {
|
|
|
|
public static int ArithmeticPB(int val) {
|
|
return val/0;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
try {
|
|
int res = ArithmeticPB(5);
|
|
System.out.println(res);
|
|
} catch(ArithmeticException e) {
|
|
System.err.println("cannot divide by 0");
|
|
}
|
|
}
|
|
}
|