java index 1 out of bound for length 1 array

https‮w//:‬ww.lautturi.com
java index 1 out of bound for length 1 array

array has a zero-based index in java
element at index 1 is second element.

/**
 * @author lautturi.com
 * Java example: array index 1 out of bound
 */

public class Lautturi {

	public static void main(String[] args) {

		int[] arr = { 1 };

		System.out.print(arr[1] );
	}
}

compile error:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
Created Time:2017-09-17 11:33:06  Author:lautturi