Ukraine flag Armor Games stands with Ukraine Ukraine flag
If you’d like to help, please consider giving to Ukraine Crisis Fund

ForumsProgramming ForumA common error in Java

1 4281
dorukayhan
offline
dorukayhan
1,318 posts
Bard

boolean woah = true;
if(woah = true){int lol;}

in this example, java will destroy ur common sense by skipping the if statement. u should do it like this instead:

boolean woah = true;
if(woah){int lol;}

here, if(woah) will actually have no difference from if(true) or if(false)

  • 1 Reply
Showing 76-75 of 1

We may use cookies to help customize your experience, including performing analytics and serving ads.
Learn More