PrintWriter println(Object) (this is the method invoked when writing System.out.println(nothingToHold) ), calls String.valueOf(x) , as described in Javadoc:
public void println(Object x)
String.valueOf(Object) converts null to null:
public static String valueOf(Object obj)
source share