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: 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 Mishax’s. The above code will compile even if theArray is primitive (possibly emitting … Read more