This just is’t making sense to me at all.
This is my code:
boolean that = false;
if (that == true);
{
System.out.println("That is " + that);
}
And yet it will print the line even though my output is
That is false
I’m doing this in java and I’m using Eclipse galileo, so each time I compile/run my program it saves it so the compiler should be getting updated version of my program.
What’s going on?
A common mistake. Remove the
;at the end of theifstatement.BTW I always write the following if I use brackets and I use the code formatter of the IDE.
This means if you have a mis-placed
;or{it can be more obvious.