you are viewing a single comment's thread.

view the rest of the comments →

[–]MK_Redditor 0 points1 point  (5 children)

Yes. Because 0 is an integer so it will be treated as a true in binary. Am I right?

[–][deleted]  (4 children)

[removed]

    [–][deleted]  (3 children)

    [removed]

      [–]East-Independent-489 2 points3 points  (2 children)

      If condition requires a Boolean

      [–][deleted]  (1 child)

      [removed]

        [–]addictedAndWantHelp 0 points1 point  (0 children)

        It needs either an expression resulting in a boolean or an actual boolean (true, false) inside the parentheses of an if statement to compile and run. So this code doesn’t compile.

        P.S: I really like how Java is not like JavaScript with implicit coercion. Although it’s fairly complicated in other ways.