In my code I want to check if the status of a Dog object is not that of 3 Enums:
if((dogList.get(i).getStatus()!= dogStatus.SLEEPING
|| dogList.get(i).getStatus()!= dogStatus.WALKING
||dogList.get(i).getStatus()!= dogStatus.EATING )){
//do something
}
Is this the correct way to combine the 3 || conditions? I ask as my program is not behaving as I expect.
Aucun commentaire:
Enregistrer un commentaire