The ternary operator is usually used to immediately assign a value.
String a = bar() ? foo() : null;
For your usecase, you can simply use an if construct:
if (foo())
bar();
The ternary operator is usually used to immediately assign a value.
String a = bar() ? foo() : null;
For your usecase, you can simply use an if construct:
if (foo())
bar();