Java #40: How to create a New Line with printf

—————-Beginning of Program—————–
//Programmer: Akinwale Owi
//Company: Dagba Computers
//Program Purpose: Use printf to make a new line

package dagbacomputers;

* @author Akin

public class DagbaComputers {

* @param args the command line arguments
public static void main(String[] args)
//Normal printing with printf
System.out.printf(“The same”);
System.out.printf(” sentence. “);


//Creating the new line with “\n”
System.out.printf(“The same” + “\n”);
System.out.printf(“sentence. “);

}//end of main
}//End of DagbaComputers Class

————–End of Program——————–


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s