There are two types of instructions to display a character string on the console screen in Java
//Command 1
System.out.print("Hello World!");
//Command 2
System.out.println("Hello World!");
When using System.out.print () ;, there is no line break after the string displayed on the console **
//Example: System.out.print();Hello World!To display two
System.out.print("Hello World!");
System.out.print("Hello World!");
The execution result is as follows.
Hello World!Hello World!
When using System.out.println () ;, ** line breaks are inserted after the character string displayed on the console **
//Example: System.out.println();Hello World!To display two
System.out.println("Hello World!");
System.out.println("Hello World!");
The execution result is as follows.
Hello World!
Hello World!
Recommended Posts