I agree with your comment, such progrmming bugs can't be prevented and we are always trying to deplete the volume of such bugs by providing better API's.
In our C++ project, i did override cout with a Log class. Consumers of this object are able to happily redirect the error messages to log file, each message in a new line. I think that such thing can be surely done in Java and i thought that it's a well known use case it's already available in java's API.
Using "\n" is easier than Calling BufferedWriter.newLine() in 2 ways
1. Usability
2. No method calling Overhead.
However, thanks a ton for letting me know the existance of newLine() method. I'm a C++ programmer and just started learning Java. Hence every piece of information about java is an interesting object for me.
I accidentally but fortunately found this forum and i hope that i will learn many things about java by following this forum. I wish that i can also help other programmers one day.
This thread can be marked closed.