There is no indexof method in Java. There is Array.Indexof method in C# but java has no such method. The method of indexOf is defined in the java docs .
Now, If our array is sorted, then it is easy, because the Arrays class defines a series of overloads of the binarySearch method that will find the index of the element, like shown below.
java.util.Arrays.binarySearch(Array, o)
But if the array is not sorted, then we have 2 further cases,
If the array is not sorted and it is not array of primitives, then using Array utility class we can use the indexOf method defined in there.
java.util.Arrays.asList(theArray).indexOf(o)
If the array is not sorted and it array of primitives, then there is no help that you can get from java APIs and you will have to write it on your own, or check out Guava's Chars.indexOf, it lets you get the index in an array.