If you look at the Java Documentation in 10.4:
Arrays must be indexed with int values; short, byte, or char values can also be used as index values, since they undergo unary numeric promotion (§5.6.1) and an int value.
Attempting to access an array component with a long index results in a compile-time error.
The error you received will look something like this:
test.java:12: possible loss of precision
found : long
required: int
System.out.println(array[index]);
^
1 error
- , long, int . , Java. , .