question 1::::
class maybe{
public static void main(
String []args)
{boolean b1=true;
boolean b2=false;
System.out.print(!false ^ false);
System.out.print(" " + (!b1 & (b2=true)));
System.out.println(" " + (b2 ^ b1));
}}
doubt::: in the 3rd println how can the output be false?in fact what the ^ operator does is check for only one true in the expression and it gets it from the b1 variable...?
question 2::::also im still not at clear with the & and | operators.
question 3:::could you please explain me the following code
class titanic{
public static void main(String []args){
Boolean b1=true;
Boolean b2=false;
Boolean b3=true;
if((b1 & b2) | (b2 & b3) & b3)
System.out.println("alpha");
if((b1=false) | (b1 & b3) | (b1 | b2))
System.out.println("beta");
}}
the output comes out to be nothing at all. please explain it step by step?
THANKS!!