Top

Discussion

Which one is a valid declaration of a boolean?

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

Answer: C

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

No comment is present. Be the first to comment.
Loading…

Post your comment