6 years ago in Java Operators

What is 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);

}

}

[A] small
[B] tiny
[C] huge
[D] compilaton fails
Loading...
Next Question

Overall Stats

Attempted 232
Correct 96
Incorrect 43
Viewed 93

Answers

Guest
Guest
Youssef Aserrar
Youssef Aserrar - 3 days ago

Youssef Aserrar from Casablanca, Morocco is saying small is correct answer

Bharath
Bharath - 2 months ago

Bharath from Hyderabad, India is saying tiny is correct answer

Renuka Siriwardhana
Renuka Siriwardhana - 4 months ago

Renuka Siriwardhana from Colombo, Sri Lanka is saying tiny is correct answer

shubham adne
shubham adne - 4 months ago

shubham adne from Pune, India is saying tiny is correct answer

Umayal Nachiappan
Umayal Nachiappan - 8 months ago

Umayal Nachiappan from Chennai, India is saying compilaton fails is correct answer

Related Questions

Which of these statements are incorrect?

  • [A] The left shift operator, <<, shifts all of the bite in a value to the left specified number of times.
  • [B] The right shift operator, >>, shifts all of the bite in a value to the right specified number of times.
  • [C] The left shift operator can be used as an alternative to multiplying by 2.
  • [D] The right shift operator automatically fills the higher order bits with 0.

Modulus operator, %, can be applied to which of these?

  • [A] Integers
  • [B] Floating – point numbers
  • [C] Both Integers and floating – point numbers
  • [D] None of the mentioned