Java MCQ - English
Which one is a valid declaration of a boolean?
Home | Discussion ForumWhich one is a valid declaration of a boolean?
boolean b1 = 1;
boolean b2 = ‘false’;
boolean b3 = false;
boolean b4 = ‘true’
Answer : C
View More Related Question
1) In Java, the word true is ................
2) Which of these values can a boolean variable contain?
3) Which of these can not be used for a variable name in Java?
4) What is the output for the below code ? public class Test
{
public static void main(String[] args)
{
byte b = 6;
b+=8;
System.out.println(b);
b = b+7;
System.out.println(b);
}
}
5) Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?