vendredi 22 décembre 2017

Cleaner way to write code snippet

I'm new to java and I was wondering if there was an easier way to write

if(a == 10 || b == 10){
    //stuff
}

In my mind I tried something like this:

if(a||b == 10){
    //stuff
}

because IMO that makes a lot of intuitive sense, but it's not a thing.

Aucun commentaire:

Enregistrer un commentaire