clear console

onzo's Avatar, Join Date: Oct 2010
Newbie Member
i write this funtion to clear the console but it says thet clear not defined for console class

import java.lang.*;
import java.util.*;

public void ClearConsole() {
Console console = System.console();
if (console == null)
System.out.println("Couldn't get Console object !");
console.clear();/////////// getting the error from this line

is there any other imports to write ???? or is there any other way to clear the console?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Duplicate of clear console. Thread closed. Please use the same thread to reply back.