This is a working code:
String a = \"first\"; String b = \"second\"; String object; System.out.println(object != null ? a : b);
But it isn\'t:<
The ternary operator should always return a value, whereas in case of SysOut the return type is void.