I couldn't remove object.How can I remove a object from an arraylist?
my code
List<kisi> x=new ArrayList<kisi>();
x.add(new kisi("1","betül"));
x.add(new kisi("2","hatice"));
x.add(new kisi("3","selma"));
kisi k=new kisi("2","hatice");
for (int i = 0; i < x.size(); i++) {
if (x.get(i).id==k.id) {
Object obj = x.remove(i);
break;
}
}
my constructor
public class kisi {
public static String id="0";
public static String ad="0";
public kisi(String id,String ad) {
// TODO Auto-generated constructor stub
this.id=id;
this.ad=ad;
}