Check out example codes for "how to get the index of an item in a array in java". It will help you in understanding the concepts better.

Code Example 1

public class ClassName {
	static void find_index(String array, String item) {
     	for (int i = 0; i < array.length; i++) {
        	if (array[i] == item) {
            	return i; 
            }
          	return false;
        }
    }
}

Learn ReactJs, React Native from akashmittal.com