PrintWriter.println(
String)
This method prints null if the argument passed to it is null.
PrintWriter.write(String)
This method throws a null pointer exception if the argument is null.
Apart from this it works the same as the write method except that it appends "\n" to the string argument.
Also the println method throws IOException while the PrintWriter.write doesn't throw IOException