Files
2024-03-15 14:05:59 +00:00

22 lines
348 B
Java

class Test {
static final int[] DATA = {1, 2, 3};
int test(int value) {
try {
return DATA[value];
}
catch (ArrayIndexOutOfBoundsException e) {
return -1;
}
}
void test2(int value) {
try {
DATA[value] = -1;
}
catch (ArrayIndexOutOfBoundsException e) {
System.out.println(e);
}
}
}