public class Main {
public static void main(String[] args) {
int[] numbers = {10, 20, 30};
// There is no index 5, so Java throws an exception here
System.out.println(numbers[5]);
System.out.println("This line never runs");
}
}
// Output:
// Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:
// Index 5 out of bounds for length 3