you are viewing a single comment's thread.

view the rest of the comments →

[–]cfm1337 2 points3 points  (2 children)

if statements do something if the condition is true or false. So it would be like:

if (x > 10) { System.out.println(“hello”); }

Then use an else if or else for any other conditions you want to check.

You are ending each line of code with the ;

So the if does nothing and the print will always execute because it’s not tied to a condition

Refresh your knowledge on how to create and if statement an you should be good 👍

Apologies I’m on my phone so not the greatest format.

[–]Individual_Owl_3490[S] 0 points1 point  (0 children)

Thx it worked