Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+23 votes
asked in CSC211_Winter2018 by (1 point)

3 Answers

+13 votes

Technically you are allowed to use "\n" instead of writing "System.out.println();"; however, it can sometimes make you're code look messy, especially if the string is very long. Personally, I just stick to rewriting "System.out.prinln()" because I feel it makes the code look a lot cleaner.

answered by (1 point)
+12 votes

Yes. The scape sequence (\n) will take you to a new line. So you don't have to use "System.out.println" every time you want to start a new line.

answered by (1 point)
+10 votes

In general, you can totally use either \n or System.out,println().

However, if you have errors and you need to trace back, \n probably makes it harder for your debugging process.

Also, I don't think it is a good idea to use multiple \n in one statement. For example, System.out.println("\n \n \n ").

answered by (1 point)
...