clear console

Discussion in 'Java' started by onzo, Oct 31, 2010.

Thread Status:
Not open for further replies.
  1. onzo

    onzo New Member

    Joined:
    Oct 31, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    i write this funtion to clear the console but it says thet clear not defined for console class


    import java.lang.*;
    import java.util.*;
    import java.io.Console;

    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?
    thx
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Duplicate of clear console. Thread closed. Please use the same thread to reply back.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice