ArrayIndexOutOfBoundsException: 1 error when using String[] and split()

Why do you have this?

Did you try to println instring? Is it comma separated?

In draw, initially the array is empty. Run the for loop to its length instead of using 10