-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintTest.java
More file actions
16 lines (14 loc) · 827 Bytes
/
PrintTest.java
File metadata and controls
16 lines (14 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public class PrintTest {
public static void main(String[] args) {
System.out.println("Hello World"); // Advance the cursor to the beginning of next line after printing
System.out.println("Hello world again!"); // Advance the cursor to the beginning of next line after printing
System.out.println(); // Print an empty line
System.out.print("Hello world!"); // Cursor stayed after the printed string
System.out.print("Hello world again!"); // Cursor stayed after the printed string
System.out.println(); // Print an empty line
System.out.print("Hello,");
System.out.print(" "); // Print a space
System.out.println("world!");
System.out.println("Hello, world!");
}
}