I'm new to java i'm trying to break if else in java with boolean but it not success:
boolean check = true;
String id = txtID.getText();
for (Employee em : list) {
if (!em.getId().equals(id)) {
check = false;
if(){
}
else{}
}
else {
JOptionPane.showMessageDialog(this, "ID exist");
check=true;
}
I want to check if the condition does not match the first IF that will show alert but it didn't work.
Aucun commentaire:
Enregistrer un commentaire