Can anyone telll me wts the function of (!b1) and (!b2) in the following code.what will be value of 'b1' and 'b2' [ i guess they are flase ..since they are instance variables]. Also how this is working in for loop.
Also can you tell me what this statement performs else if(b1 | b2). This seems to be basic operator questions..but i was a bit confused
public class Example1 {
static boolean b1,b2;
public static void main(
String[] args) {
int x=0;
if(!b1){
if(!b2){
b1 = true;
x++;
if(5>6){
x++;
}
if(!b1) x= x+10;
else if(b2= true)x=x+100;
else if(b1 | b2)x=x+1000;
}
}
System.out.println("Value of X:" +x);
}
}
