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?

13th Feb 2017, 3:13 AM
Poramet Supakitruengroj
Poramet Supakitruengroj - avatar
3 ответов
+ 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.
13th Feb 2017, 3:18 AM
Nahuel
Nahuel - avatar
+ 1
You can use system.exit(0); in the if block Pls tell me if it works
13th Feb 2017, 6:35 AM
Prerit Kumar
Prerit Kumar - avatar
0
can it clear only one line that is previous?
13th Feb 2017, 3:37 AM
Poramet Supakitruengroj
Poramet Supakitruengroj - avatar