mardi 1 décembre 2020

how to change the conditionals in my program from an if to a ternary in java

if (id == 0)
    return "To start playing the game press \"play\"";
} else {
    return Game.play(message, players.get(id));
}

I would like to change this part of my code to a ternary operator instead of an if statement. how can I do that?

Aucun commentaire:

Enregistrer un commentaire