Why is this an issue?
While the ternary operator is pleasingly compact, its use can make code more difficult to read. It should therefore be avoided in favor of the more
verbose if
/else
structure.
Noncompliant code example
System.out.println(i>10?"yes":"no");
Compliant solution
if (i > 10) {
System.out.println(("yes");
} else {
System.out.println("no");
}