"boolean1 = boolean2" and "boolean1 == boolean2"

see the expressions (sorry, I'm a Chinese. I can a little English)

boolean bl;

if ( bl = false){// "="not "=="

...

}

it has problems. but I compiled it ,and run.

of course, the result has problems.

I don't know why it can run. I use JDK 1.5 bete;

[305 byte] By [cone.cn] at [2007-9-30 6:29:12]
# 1
oh I know."bl = fasle" is boolean
cone.cn at 2007-7-1 21:01:12 > top of Java-index,Administration Tools,Sun Connection...
# 2
= is an assignment== is a comparisonThe assignment expression (=) also returns a value; the value on the right hand side.
jesperdj at 2007-7-1 21:01:12 > top of Java-index,Administration Tools,Sun Connection...