Hi lakshmi,
not only booleans u can declared any primitives like that..
For example..
public class My {
public static void main(String args[]) {
int i = 0;
int j = 0;
boolean t = true;
boolean r;
//boolean w;
int y;
r = (t & 0<(i += 1));
System.out.println(i + " " + j);
r = (t && 0<(i += 2));
System.out.println(i + " " + j);
r = (t | 0<(j += 1));
System.out.println(i + " " + j);
r = (t | | 0<(j += 2));
System.out.println(i + " " + j);
//r = (w | | 0<(j += 2));
//System.out.println(i + " " + j);
y = j;
System.out.println(y);
}
}
Here note that y is not initialized.
Also if we remove the commented lines , we will get compiler error... because boolean w is not initialized but used in RHS.
Hope this clarifies ur doubt..
Jeban.