Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8057699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:06:54+00:00 2026-06-05T09:06:54+00:00

Possible Duplicate: How to delete stuff printed to console by System.out.println()? I have a

  • 0

Possible Duplicate:
How to delete stuff printed to console by System.out.println()?

I have a Pickle class that serializes a linked list of words and word counts. Everything works, except that the console doesn’t clear when I save and load the data. Even when I leave eclipse and run the program again, the old console output appears along with the new output. Is there anyway to clear the console before loading the object data? Here is my save method:

void save(T obj){
    try{
        FileOutputStream fos = new FileOutputStream(filename);
        ObjectOutputStream out = new ObjectOutputStream(fos);
        out.writeObject(obj);
        out.close();
    }catch(Exception e){
        System.err.println(e);
        System.exit(1);
    }
}

and my load method:

T load(){
    try{
        FileInputStream fis = new FileInputStream(filename);
        ObjectInputStream in = new ObjectInputStream(fis);
        temp = (T) in.readObject();
        return temp;
    }catch(FileNotFoundException f){
        System.err.println("Warning! File Not Found. Null is returned");
        System.exit(1);
        return null;
    } catch (Exception e) {
        System.err.println(e);
        System.exit(1);
        return null;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:06:56+00:00Added an answer on June 5, 2026 at 9:06 am

    I came across this problem before. It’s quite a doozy. I was able to do it by using a free/open source library called JLine http://jline.sourceforge.net/ It is quite a nice library and has support for Unix and Windows terminals including entering passwords. It also has a “clearScreen()” method to clear the screen.

    I suggest you use JLine and see if it suites your needs. I can assure you that its a nice library and I’m sure you’ll find its other features useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: delete vs delete[] operators in C++ I've written a class that contains
Possible Duplicate: how to delete row from datagridview with a delete button? I have
Possible Duplicate: MySQL delete row from multiple tables I have 5 tables: members member_videos
Possible Duplicate: Prolog delete: doesn't delete all elements that unify with Element In Prolog
Possible Duplicate: xCode 4 -reinstalls keychain certs that I delete The question says it
Possible Duplicate: How to delete an element from an array in php? I have
Possible Duplicate: PHP: Is there a command that can delete the contents of a
Possible Duplicate: Delete values selected using checkbox I want to delete records that has
Possible Duplicate: How Do You Delete Duplicate Records In SQL I have a table
Possible duplicate Hello all. I have confusion in drop query that how actually it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.