I\'d like know why the following program throws a NPE
public static void main(String[] args) { Integer testInteger = null; String test = \"test\" + t
Without the brackets it's doing this effectively: String test = ("test" + testInteger) == null ? "(null)" : testInteger.toString(); Which results in an NPE.
String test = ("test" + testInteger) == null ? "(null)" : testInteger.toString();