indexOf() Method : Java.util.ArrayList

   

Declaration :

Explanation :

Purpose Method returns the index of the first occurrence of the specified element in list
Parameters obj ==> The element to search for
Return Value Returns the index of the first occurrence of the specified element
Exception NA

Example

The following example shows the usage of java.util.Arraylist.indexOf() method.

Output :