ArrayList implementation defines an indexOf(Object o) , which gives an index, but that method is not on all collection implementations. Both ... ... <看更多>
To find the position of an element in an array, you use the indexOf() method. This method returns the index of the first occurrence the element that you want to ... ... <看更多>