yes, that's correct.
the statement: if (b=true)
is actually an assignment to b, this assignment gives a return value, the same as the right hand value.
so (b=true) will return true.
try the following example:
public class X {
public static void main (
String[] args) {
boolean b=false;
int i=0;
String s="initial value";
System.out.println(b=true);
System.out.println(i=Integer.MAX_VALUE);
System.out.println(s="new value");
}
}
it'll result in:
true
2147483647
new value
- eric