Ask coding questions

← Back to all posts
0
clear console in repl.it Java
Camilo_ReneRen1 (0)

Hi!
Can anybody help me to clear console in a Java program at repl.it?
Please!

Commentshotnewtop
1
utgtest (0)

There is a a much better way to do this:

System.out.print("\033[H\033[2J");
System.out.flush();

1
CSharpIsGud (40)

Try outputting this \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n

It does not really clear the console but you wont be able to see any text that was there before you outputted them

1
PYer (2046)

@CSharpIsGud Yeah, I do that to with python. But a shorter way would be to do "\n"*100 :)

1
RyanRana (152)

I do not believe it is possible but why would you need to any way?

1
BlueLightning42 (1)

Sorry clearing the console is only supported in python as of this moment

1
PYer (2046)

@BlueLightning42 Only with eval mode though. You have to import the replit module. You cannot do it in a .py file.