Home / Java Programming / Java.lang Class :: Discussion

Discussion :: Java.lang Class

  1. What will be the output of the program (in jdk1.6 or above)?

    public class BoolTest  {     public static void main(String [] args)      {         Boolean b1 = new Boolean("false");         boolean b2;         b2 = b1.booleanValue();         if (!b2)          {             b2 = true;             System.out.print("x ");         }         if (b1 & b2) /* Line 13 */         {             System.out.print("y ");         }         System.out.println("z");     } } 

  2. A.
    z
    B.
    x z
    C.
    y z
    D.
    Compilation fails.

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question. Let us discuss.


Be The First To Comment