Naveen Megharaj wrote:i know that it will print true, but i want to know how the "condition" with in the "if statement" simplifies.........
A couple of points.... First, the logical AND has higher precedence than the logical OR, so the condition would be like this (if using parens)....
Second, the logical AND is a short circuit operator, so when the "x>3" portion is false, it will skip the check for the "y<2", and immediately return false.
Third, the logical OR is also a short circuit operator, but can't short circuit because the left side is false. It will call the doStuff() method which returns true -- and generates a logical OR result of true.
Hence, the condition in the "if" statement is true...
Henry