mercredi 14 janvier 2015

How to show !equals in if statement (Java)? [duplicate]


This question already has an answer here:




How is it possible to show if it's not equal (!=, something like this maybe) in an if statement? For example:



for (int g = 0; g < doglist.size(); g++){
if(doglist.get(g).equals(name)){
System.out.println("There is no dog with that name: ");
}
}


So in this code I want to print the message if the entry in the list is not equal to name. So instead of equals(name) I'll have to use something different. How is this possible?


Aucun commentaire:

Enregistrer un commentaire