#Part of code still runs, even when the condition is false

7 messages · Page 1 of 1 (latest)

hearty crag
#

even if one of the conditions are false, they both run. I always get both messages

scarlet smeltBOT
#

This post has been reserved for your question.

Hey @hearty crag! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

hearty crag
#

im pretty new to java so this is confusing the hell outta me

icy sinew
#

I'd suggest making the second if into an else if. Because instead of running as one or the other, it's seeing both as separate conditions, if that makes sense

#

Or an else because this is a yes or no scenario. An else if works if you've got more than one or 2 conditions to check for

hearty crag
#

closing the post, someoen told me im not supposed to but the semi colon at the end of the if statement lol