Ask coding questions

← Back to all posts
How to clear the console in Java?
PythoNinja (2)

I'm having trouble about how to clear the console in Java... please help. Thanks!

Answered by Aivoybia (26) [earned 5 cycles]
View Answer
Comments
hotnewtop
Aivoybia (26)
System.out.print("\033[H\033[2J");
System.out.flush();
InvisibleOne (3227)
console.clear()

but I might be wrong

InvisibleOne (3227)

Whoops, I thought it was Javascript.