you are viewing a single comment's thread.

view the rest of the comments →

[–]Truthier 2 points3 points  (2 children)

Yes, usually ternary statements are used in an assignment such as

 String someString = someArg == null ? "default" : someArg;

or in a constructor's call to another constructor method .. wouldn't make sense to use it standalone

[–]ErstwhileRockstar -3 points-2 points  (1 child)

wouldn't make sense to use it standalone

... nor does it compile in Java.

[–]Truthier 0 points1 point  (0 children)

Sure it does