Print in new line, java
System.out.println("hello"+"\n"+"world");
String newLine = System.getProperty("line.separator");//This will retrieve line separator dependent on OS.
System.out.println("line 1" + newLine + "line2");
System.out.println("hello"+"\n"+"world");
String newLine = System.getProperty("line.separator");//This will retrieve line separator dependent on OS.
System.out.println("line 1" + newLine + "line2");