While reading about Java I/O, i realized that there are two ways through which i can write to the standard output.
Following is the snippet that uses both the techn
A quick Google revealed a thread on Coderanch which was useful.
There are several other ways of doing console writing but there seems to be no real benefit of using one or the other apart from less code to write and that the creation of a new PrintWriter object will take up more memory (eventually).
PrintWriter can write to other sources than just the console, it can write to an HttpResponse for example whilst System.out.println only writes to console.