posted 19 years ago
I have a question regarding why when the following is run the statement "b is true" is printed to the screen. I would think that I am setting b to be false before the if statement runs. The first check also sets it to false so I would think that b is false would be printed.
boolean b = false;
if(b = false) {
System.out.println("b is false");
} else if(b = true){
System.out.println("b is true");
} else {
System.out.println("b is not true or false");
}