V

Vinay • 28.75K Points
Instructor II

Q. What will be the output of the following Java code?

Code:
class bool_operator 
{
    public static void main(String args[]) 
    {    
         boolean a = true;
         boolean b = !true;
         boolean c = a | b;
   boolean d = a & b;
         boolean e = d ? b : c;
         System.out.println(d + " " + e);
    } 
}
  • (A) false false
  • (B) true ture
  • (C) true false
  • (D) false true
  • Correct Answer - Option(D)
  • Views: 18
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics