How to update object in Collection (Java)
class librarian{
private String firstname;
private String lasttname;
private String Id ;

public librarian(String fstname,String lstname, String id)
{
firstname = fstname;
lasttname = lstname;
Id = id ;

}
... ... ...
.... ... ...
... ... ...

Collection librariancollection = new ArrayList();
class librarian lib_objects;
.. ... ...

firstname = JOptionPane.showInputDialog("Please Enter First Name:");
lasttname = JOptionPane.showInputDialog("Please Enter Last Name:");
id = JOptionPane.showInputDialog("Please Enter Id number:");
address = JOptionPane.showInputDialog("Please Enter Address:");

lib_objects = new librarian(firstname,lasttname,id,address);
librariancollection.add(lib_objects);


This is my code , I would like to do search for specific id, and edit, delete also. Could you help me how can I do it in collection.

Thanking advance
Maynul