how to create multiple lines without using “println” multiple times

println” creates a new line, to create multiple lines in one print statement try this :

String  l = System.getproperty("line.seperator");

System.out.print("Add" + l + "new" + l + "line");

Or

 
System.out.print("Add" + System.getproperty("line.seperator") + "new" +System.getproperty("line.seperator") + "line");

Leave a Reply

Your email address will not be published. Required fields are marked *