posted 24 years ago
Original Code:
int i = 10;
int j = 10;
boolean b = false;
if(b= i == j)
System.out.println("True");
else
System.out.println("False");
To make the if statement more clear, look at it this way:
if(b = (i==j))
Here, i==j returns true, which is assigned to b. Now, your if statement has its required boolean condition - b - which is true. Hence the result.