public class Main { public static void main(String[] args) { int[] ints = new int[10]; System.out.println("before out-of-bounds"); System.out.flush(); int a = ints[-1]; }}
Standard input is empty
before out-of-bounds
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at Main.main(Main.java:6)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!