0
OUTPUT
if I want to hide output such as System.out.print("Input a : "); a=sc.nextDouble(); if (a==0) { // hide output "Input a : " // <-- what statement can help me?
3 Answers
+ 4
try this function:
public static void clearScreen() {
System.out.print("\033[H\033[2J");
System.out.flush();
}
Not sure if it works on windows, this clear all the screen.
+ 1
You can use system.exit(0); in the if block
Pls tell me if it works
0
can it clear only one line that is previous?