I am maintaining one ArrayList
of objects. And my object structure is Id, name, some other details. I need to remove one the object with some id value say(10) a
You could not do that without iterator, you should you Hashmap for this.
public class ObjectStructure{
private int Id;
private String name;
//and any data field you need
}
generate all setters and getters.
Use this class in
Hashmap data = new HashMap<>();
you can add and delete data with only key which is Integer.
data.remove(10);