dimanche 4 octobre 2015

Java - Multiple accepted inputs"

I was just curious how you would accept multiple inputs in Java, from what I have tried you're unable to use the logical OR operators ||.

So if I wish to have multiple accepted inputs accepted for an IF statement how would I do this? if (userinput.equalsIgnoreCase("House" || "Home")) How can I have both House and Home activate this without creating an else statement?

Aucun commentaire:

Enregistrer un commentaire