Possible Duplicate:
search in java ArrayList
If I have an ArrayList of employee objects and each object contains a string: employeeName and long: employeeNumber.
How do I search the list for an employee given their employee number and return the employee object?
Something along these lines. But it could be better to put the objects in a
HashMap<Long,Employee>where long is the id, and Employee is the employee belonging to that id.