Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
public class ExceptionExample {
public static void main(String[] args) {
try {
int result = 10 / 0;
} catch (ArithmeticException e) {
System.out.println("Cannot divide by zero");
} finally {
System.out.println("Execution finished");
}
}
}Coding works best on desktop or with an external keyboard.