Java MCQ - English
Operator MCQ Questions and Answers
Home | Java | OperatorJava Operator MCQ Questions and Answers: Here learn quiz questions on Java Operator and download pdf of 50 most important objective questions for all competitive exam.
1) What will be the output of the program? class Test
{
public static void main(String [] args)
{
int x=20;
String sup = (x < 15) ? "small" : (x < 22)? "tiny" : "huge";
System.out.println(sup);
}
}
2) Which of these can be returned by the operator & ?
3) Which of the following can be operands of arithmetic operators?
4) Modulus operator, %, can be applied to which of these?
Answer : C Discuss
5) Decrement operator, −−, decreases value of variable by what number?
6) Which of these statements are incorrect?
Answer : D Discuss
7) What will be the value of "x" after execution ?int x = 0, y = 0 , z = 0 ;
x = (++x + y-- ) * z++;
8) What will be the output of the above fraction of code ?int ++a = 100 ;
System.out.println( ++a ) ;
Answer : C Discuss
9) What is the output of the following program ?class Numbers{
public static void main(String args[])
{
int a=20, b=10;
if((a < b) && (b++ < 25))
{ System.out.println("This is any language logic");
}
System.out.println(b);
}
}
10) Select from among the following character escape code which is not available in Java.