Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The process for obtaining the index of a particular item in a list in Java is as follows:

  1. Instantiate a List object containing the items you wish to search.
  2. Call the indexOf(Object o) method on the List object, passing in the object you want to find the index of.
  3. The method will return the index of the first occurrence of the object in the list, or -1 if the object is not found.