Level 10

java

#1

trying to set the variable to L R or C

char penaltyKick = 'L', 'R' or 'C';

But thats not working any ideas, cant find what im looking for on google.


#2

Guess this means you should pick one of them not all 3 :smile:


#3

First of all you shouldnt pick all three im preety sure. Not 100% but if your gonna use or do this

char penaltyKick = 'L' || 'R' || 'C';

I personally would create three chars and name them penalityKickR, penalityKickC, penalityKickL...


#4

In javaScript "L" would have a truthy value and would therefore be picked no matter what. I'm not sure how java handles it, still I would be careful with using || for non booleans unless I know exactly what happens.