Home / Java Programming / Language Fundamentals :: Discussion

Discussion :: Language Fundamentals

  1. Which one is a valid declaration of a boolean?

  2. A.
    boolean b1 = 0;
    B.
    boolean b2 = 'false';
    C.
    boolean b3 = false;
    D.
    boolean b4 = Boolean.false();
    E.
    boolean b5 = no;

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    A boolean can only be assigned the literal true or false.


Be The First To Comment