โ Back to Printing
Question 274
Newline Inside a String
Newline Inside a String
Using a SINGLESystem.out.println()call, print two lines by placing a\ninside one string: Line1 Line2 The\nbreaks the string into two lines, and println adds the final newline.
Expected Output:
Line1 Line2
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.