91. What will be the output of the following Java code?
class bool_operator
{
public static void main(String args[])
{
boolean a = true;
boolean b = !true;
boolean c = a | b;
boolean d = a & b;
boolean e = d ? b : c;
System.out.println(d + " " + e);
}
}
class bool_operator
{
public static void main(String args[])
{
boolean a = true;
boolean b = !true;
boolean c = a | b;
boolean d = a & b;
boolean e = d ? b : c;
System.out.println(d + " " + e);
}
}
92. Which of these selection statements test only for equality?
93. Which of these statements is correct?
94. What is the output of relational operators?
95. What is the valid data type for variable "a" to print "Hello World"?
switch(a)
{
System.out.println("Hello World");
}
switch(a)
{
System.out.println("Hello World");
}
96. Which of the following is not a valid flow control statement?
97. The while loop repeats a set of code while the condition is not met?
98. What will be the output of the following Java code?
class ternary_operator
{
public static void main(String args[])
{
int x = 3;
int y = ~ x;
int z;
z = x > y ? x : y;
System.out.print(z);
}
}
class ternary_operator
{
public static void main(String args[])
{
int x = 3;
int y = ~ x;
int z;
z = x > y ? x : y;
System.out.print(z);
}
}
99. What is true about a break?
100. Which of these have highest precedence?
Read More Section(Operators)
Each Section contains maximum 100 MCQs question on Operators. To get more questions visit other sections.