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
There are not only two ways, you can also find some other ways to do this. For example using Consol class of io package, and may some more classes present for this.
But if you just want to print something in the consol, then I think first method is the best. Why should you go for 4 to 5 lines of code if it can be done in just 1 line.