Yes its possible. All you need to remember the result of an expression within if, while, do while, for constructs must be a boolean.
Hence if you have
boolean b1 = false;
if((b1=true)) {System.out.print("Test");}
Here b1 will be assigned false and the output will be
Test.
Also with
Java 1.5
Boolean b1 = false;
if((b1=true)) {System.out.print("Test");}
will also work, Here b1 will be autoboxed to false during initialization and in the if statment true will be assigned to b1 via autoboxing and then its unboxed to boolean true and the result is "Test".
Hope this clears.
Thanks
Deepak