lundi 1 octobre 2018

How to write this method without an if statement

Below I have a method I wrote for a project I am doing. I did write it with an if statement, but I want to know how to wite it without one. How can I transfer this coding to not have an if statement? Thank you!!!

public static boolean opposite(boolean verticalToPlay)
{
if(verticalToPlay == true)
{
return false;
}
return true;
}

Aucun commentaire:

Enregistrer un commentaire