Users Pricing

forum

Home Forums Trouble with ternary tester – MindStick

Trouble with ternary tester

Anonymous User 1923 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 ) 

1 Answers

Anonymous User 28 Apr 2015 Accepted Answer
Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md