java里实现console清空
private static void clearConsole()
{
try
{
String os = System.getProperty("os.name");
if (os.contains("Windows"))
{
Runtime.getRuntime().exec("cls");
}
else
{
Runtime.getRuntime().exec("clear");
}
}
catch (Exception exception)
{
// Handle exception.
}
}