ForumsProgramming ForumA common error in Java

1 5274
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
Jtom2k
offline
Jtom2k
43 posts
Nomad

Yeah the Java!

I was always thinking of learning Java, but went straight on to Javascript.

Showing 1-1 of 1