Skip to content
← Back to Community
How to clear the console in Java?
Profile icon
PythoNinja

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

Answered by Aivoybia [earned 5 cycles]
View Answer
Voters
Profile icon
PythoNinja
Comments
hotnewtop
Profile icon
Aivoybia
System.out.print("\033[H\033[2J"); System.out.flush();
Profile icon
PythoNinja

@Aivoybia Thanks!

Profile icon
Aivoybia
Profile icon
InvisibleOne
console.clear()

but I might be wrong

Profile icon
InvisibleOne

Whoops, I thought it was Javascript.