System.out.println() vs \\n in Java
Let's say I wanted to print 5 lines. Which is the best method (for performance and readability). System.out.println(); System.out.println(); System.out.println(); System.out.println(); System.out.println(); or System.out.println("\n\n\n\n"); Is it a matter of preference or is one better than the other. It seems like it would save a lot of time using the second method. There is a functional difference between the two. The first version outputs line breaks using the platform's preferred line separator. The second version outputs newline characters, which is likely to be inappropriate on Windows