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. 回答1: There is a functional difference between the two. The first version outputs line breaks using the platform's preferred