Files
DEV/DEV.2.1/TP/TP10-Exceptions/2./Capture.java
EmmanuelTiamzon 7019a3b7ea update
2025-09-30 09:43:41 +02:00

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");
}
}
}