indexOf is a method for Strings. To see where the element is at, loop through the array, checking each value to see if it matches, and when you get to it, return the number of the loop tracking in (the int)
int index;
for(int i = 0; i < array.length; i++) {
if(array[i] == ']') {
index = i;
}
}