You read a value from an array using the index in square brackets:
int[] scores = {90, 85, 78, 92, 88};
System.out.println(scores[0]); // 90
System.out.println(scores[3]); // 92
Remember that indices start at . The first element is scores[0], and the last element is scores[4] for an array of length .
If you use an index that is negative or equal to (or greater than) the array's length, Java throws an ArrayIndexOutOfBoundsException at runtime. The compiler will not catch this for you. It only appears when the program runs and hits that line.