vendredi 18 juin 2021

How do I write a clean conditional statement

This may be a dumb question but what is an easy way to write a clean condition statement, for example lets say if I have a conditional statement where I only want it to happen before a block of code if it meets the requirement and if it doesn't then I want it to happen after the block of code. But it must happen in that order

if(number == 250){
    // sameMethod()
}

//random code

if(number != 250){
    // sameMethod()
}

Aucun commentaire:

Enregistrer un commentaire