} } in the above code on compilation showing the following error exception at runtime because in the 2nd if we are assinging b1 to false but what is given in the kb book is that the result of any assignment is the value of the variable after the assignment, the expression (b1 = true) has a result of true. Hence, the if test should succeeds. then why is error
You have a syntax error if((bl = false) )| (b1 & b3) | (bl | b2)) There is an addional ) Once you remove this and compile the code will compile correctly and there will be no run time exception and since b1 is assigned false in the above if statement the code will run but will not produce any output. And yes b1 should be bl or vice versa , THis was driving me nuts but i finally figured it out b1 and bl look almost same.