fin
This commit is contained in:
5
DEV2.1/Exception/ex1/ArithmeticException.java
Normal file
5
DEV2.1/Exception/ex1/ArithmeticException.java
Normal file
@@ -0,0 +1,5 @@
|
||||
public class ArithmeticException {
|
||||
public static void main(String[] args) {
|
||||
int result = 10 / 0; // Division par zéro
|
||||
}
|
||||
}
|
||||
7
DEV2.1/Exception/ex1/ArrayIndexOutOfBoundsExample.java
Normal file
7
DEV2.1/Exception/ex1/ArrayIndexOutOfBoundsExample.java
Normal file
@@ -0,0 +1,7 @@
|
||||
public class ArrayIndexOutOfBoundsExample {
|
||||
public static void main(String[] args) {
|
||||
int[] array = new int[5];
|
||||
System.out.println(array[10]); // Tentative d'accès à un index inexistant
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user