title: Find index of an object in ArrayList depending on the value of an attribute in Java
body: <p>I am using Java 7. Is it possible to get the index of an Object in an ArrayList depending on a particular attribute value. eg:</p>
  
  <pre><code>class Abc{
    String first_name;
    String last_name;
    // getter and setters...
  }
  </code></pre>
  
  <p>Now</p>
  
  <pre><code>List&lt;Abc&gt; abcList = new ArrayList();
  Abc abcObj = new Abc();
  abcObj.setFirst_name("Jeet");
  abcObj.setLast_name("Adhikari");
  abcList.add(abcObj);
  
  Abc abcObj2 = new Abc();
  abcObj2.setFirst_name("John");
  abcObj2.setLast_name("Something");
  abcList.add(abcObj2);
  </code></pre>
  
  <p>Now is there any better way without iterating to get the index of the object in <strong>abcList</strong> where <strong>name = "John"</strong>.</p>