Ask coding questions

← Back to all posts
New Line
talynnhardy

How to start a new line? Is my coding correct so far? Please let me know.

Answered by RYANTADIPARTHI [earned 5 cycles]
View Answer
Voters
talynnhardy
Comments
hotnewtop
RYANTADIPARTHI

Solution

to put a new line in java, use \n.

like that. You can add more.
It should work

IntellectualGuy

Easy just put \n

or you could write System.out.println instead of System.out.print, both of those should work


Btw I suggest using proper indentation in java, it can make your code way easier to read

EpicGamer007

to print a new line, put \n in the string

ObiVibKenobi

Hi there! I don’t know much java, but I do know that to print a new line, you could replace print with printf and put in %n where new lines should be. So, you could replace your code with this: