dimanche 31 décembre 2017

Switch on an if statement?

I am a bit of a beginner with coding, so can someone please tell me if it is possible to do something like this in Java, in a void result type?

switch (if this != null {return this;}
            else {return that;}) {

    case "This": blah
        break;
    case"That": blah
        break;
}

Also, can anyone tell me the most efficient way to do a switch statement with two variables? Thanks! :)

Aucun commentaire:

Enregistrer un commentaire