Java MCQ - English
Which of these values can a boolean variable contain?
True & False
0 & 1
Any integer value
true
Answer : A
View More Related Question
1) What is the output for the below code ?
public class Test
{
public static void main(String[] args)
{
int i = 010;
int j = 07;
System.out.println(i);
System.out.println(j);
}
}
8 7
10 7
Compilation fails with an error at line 3
Compilation fails with an error at line 5
View Answer
2) Which of these is long data type literal?
3) In Java, the word true is ................
4) Which one is a valid declaration of a boolean?
5) Literal can be of which of these data types?