Where is Java’s Array indexOf?
There are a couple of ways to accomplish this using the Arrays utility class. If the array is not sorted and is not an array of primitives: java.util.Arrays.asList(theArray).indexOf(o) If the array is primitives and not sorted, one should use a solution offered by one of the other answers such as Kerem Baydoğan’s, Andrew McKinlay’s or … Read more