Java MCQ - English
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);
}
}
Answer : B
View More Related Question
1) Modulus operator, %, can be applied to which of these?
View Answer
2) What will be result of the result of the expression -14%-3
3) Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?
View Answer
4) 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);
}
}
5) If a=20 and b=15 then the statement x=(a>b) ? a:b; will assign value of x.