What does java.lang.ArrayIndexOutOfBoundsException mean? [duplicate]

java.lang.ArrayIndexOutOfBoundsException means you are trying to access a array index that doesn’t exist.

The problem is that your array is of size one.However, you are going through that loop six times. You can either make n equal to one, or increase the size of your array.

Leave a Comment