forum

Home / DeveloperSection / Forums / Trouble with ternary tester

Trouble with ternary tester

Anonymous User 1492 28-Apr-2015
Could someone please help me make sense of this ternary operator. I checked the web and couldn't find any examples to clear it up for me. All the examples I saw included only one boolean expression followed by expression1 : expression 2. 

  int x = 5;
   System.out.println(x > 2 ? x < 4 ? 10 : 8 :7);
}}

It looks like it is ( booleanExpression ? booleanExpression ? not sure here : expression1 : expression2 ) 

Updated on 28-Apr-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By