View Single Post
Old Jul 28th, 2007, 5:22 AM   #13
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
So just by itself, the result 1000 0000 doesn't necessarily mean true to Java. You have to go one step further and include a comparison operator in your if statement like this:

if (result != 0)
   System.out.print("This line will execute.");

else
   System.out.print("You won't see this.");

The end result of explicitly adding the != operator to your if statement is that Java will actually compare the result(1000 0000) to 0(!= 0) and then the end result of that will in fact be either a true or a false, meaning the outcome will be in fact a boolean value. Then the compiler will go ahead and execute the appropriate line. God I hope I got this correct.
357mag is offline   Reply With Quote