Finding dupicates in list models [duplicate]
This question already has an answer here:
How do I compare strings in Java? 28 answers
I'm trying to find duplicates in a list model. I have tried this there
seems to be something wrong it isn't showing any errors, but then it
doesn't display or respond. Is there something wrong?
Help please
try{
for(int x=0;x<def.getSize();x++){
if(((String)def.elementAt(x)).equalsIgnoreCase(selec)){
System.out.println("duplicate found");
}else{
def.addElement(selec);
com1.addElement(selec);
com2.addElement(selec);
com3.addElement(selec);
com4.addElement(selec);
}
}
}
catch(Exception e){
System.out.println(e);
}
def.addElement(selec);
No comments:
Post a Comment