What command in Java will let you clear the console in a command-line application?
System.out.println("Hello!");
prints the specified string and then moves the cursor to the next line.
System.out.print("Hello!");
prints the specified string and leaves the cursor immediately after that string.
To solve the problem, identified above, of the cursor being on the second line of the console, use print
instead of println
.