Dear Java guru \'s!
Can you, please, explain me, why String concatenation does not work properly in Java when concatenating 2 results of ternary operators?
I think you intended
String x = (str != null ? "A" : "B") + (str == null ? "C" : "D");