Language Fundamentals

Q1: 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;

ANS:C - boolean b3 = false;

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



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.