samedi 25 août 2018

Better way to compare d in the if statment. What if i need to compare it to say 100 values?

Better way to compare d in the if statement. What if i need to compare it to say 100 values?

int d = 0;
if(d == 3 || d == 8 || d == 1) {
   System.out.println("d is one of the special numbers!");
}

Aucun commentaire:

Enregistrer un commentaire