Skip to content
Sign upLog in

New Line

Profile icon

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

You are viewing a single comment. View All
Profile icon


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

class Main { public static void main(String[] args) { System.out.print("Enter the monthly subscription fee: \n"); # newline System.out.print("9.99"); System.out.print("Enter the number of paying customers: \n"); # newline System.out.print("26000000"); System.out.print("This company makes $259740000 per month"); System.out.print("This company makes $3116880000 per year"); } }

like that. You can add more.
It should work