title: Getting Index of an item in an arraylist;
body: <p>I have a Class called <code>AuctionItem</code>. The <code>AuctionItem</code> Class has a method called <code>getName()</code> that returns a <code>String</code>. If I have an <code>ArrayList</code> of type <code>AuctionItem</code>, what is the best way to return the index of an item in the <code>ArrayList</code> that has a specific name?</p>
  
  <p>I know that there is an <code>.indexOf()</code> function. The parameter for this function is an object. To find the item that has a name, should I just use a for loop, and when the item is found, return the element position in the <code>ArrayList</code>?</p>
  
  <p>Is there a better way? </p>