MCQ Single Best Answer Not Set

QWhich one is a valid declaration of a boolean?

ID: #1990 Java Language Fundamental 27,442 views
Question Info
#1990Q ID
Not SetDifficulty
Java Language FundamentalTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A boolean b1 = 0;
  • B boolean b2 = 'false';
  • C boolean b3 = false;
  • D boolean b4 = Boolean.false();
Correct Answer: Option C

Explanation

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

Share This Question

Challenge a friend or share with your study group.