ForumsProgramming ForumA common error in Java

1 1081
dorukayhan
offline
dorukayhan
1,325 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 31-30 of 1