Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. Which one is a valid declaration of a boolean?
  2. A.
    boolean b1 = 1;
    B.
    boolean b2 = 'false';
    C.
    boolean b3 = false;
    D.
    boolean b4 = 'true'

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Boolean can only be assigned true or false literals.


Be The First To Comment