Home » JAVA Programming » Basic Datatypes » Question
  1. What is the output of this program?

    class booloperators {
    public static void main(String args[])
    {
    boolean var11 = true;
    boolean var12 = false;
    System.out.println((var11 & var12));
    }
    }
    1. 0
    2. true
    3. false
    4. 1
    5. None of these
Correct Option: C

boolean ‘&’ operator always returns true or false. var1 is defined true and var2 is defined false hence their ‘&’ operator result is false.
output: false



Your comments will be displayed only after manual approval.