Why System.out.print doesn't work with the "null" in the ternary operator?