Mega Code Archive

 
Categories / Java Tutorial / Development
 

The %n inserts a newline

import java.util.Formatter; public class MainClass {   public static void main(String args[]) {     Formatter fmt = new Formatter();     fmt.format("Copying file%nTransfer is %d%% complete", 88);     System.out.println(fmt);   } } Copying file Transfer is 88% complete