lastIndexOf() Method : Java.util.ArrayList


Declaration :

Explanation :

Purpose Method returns the index of the last occurrence of the specified element in this list or -1 if this list does not contain the element
Parameters obj ==> The element whose presence in this list is to be tested
Return Value Method returns the index of the last occurrence of the specified element in this list
Exception NA

Example

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

Output :