Java MCQ - English
Which of these values can a boolean variable contain?
Home | Discussion ForumWhich of these values can a boolean variable contain?
Answer : A
View More Related Question
1) What will be the output for the below code ?
public class Test
{
public static void main(String[] args)
{
byte i = 128;
System.out.println(i);
}
}
2) 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);
}
}
View Answer
3) Which one is a valid declaration of a boolean?
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) Literal can be of which of these data types?