- Home /
Question by
TheYoyii · Sep 14, 2013 at 07:07 PM ·
line drawingjava to c#no error
Expressions in statements must only be executed for their side-effects.
Hello !
I try to use a script in java to make a flashlight but i got this error. This is the line:
turnedOn != turnedOn;
Thank you for your anwsers.
Comment
Answer by OperationDogBird · Sep 14, 2013 at 07:35 PM
Looks like you want to say
turnedOn = !turnedOn;
this will flip the boolean. What you are saying above is true does not equal true, which doesnt make sense logically. I bet the ! is just on the wrong side of the equal sign.
Please mark the question as answered if this did solve your problem. It will give you some points and also make it easy for people with the same problem to find the answer quickly. Thanks, glad to help.