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 8662447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:44:22+00:00 2026-06-12T16:44:22+00:00

Possible Duplicate: Using Java, how do I create a console application which manipulates text

  • 0

Possible Duplicate:
Using Java, how do I create a console application which manipulates text in system.out?

I have absolutely no idea how to ask this question. I guarantee it’s out there somewhere if one did a Google search (ironic that I don’t know how to search for it).

I know that you can output data in Java. An example would be to use System.out.println. If you wanted to print the update value, use that statement again and it prints a new line with the changed value. I don’t want to keep using print/println every time it changes. That would create a ton of statements. I’m looking for that one line to be refreshed. So say it refreshes every second to display a new value if there is one.

Value of x is: 5

Now, it is constantly refreshing and the number will change if it has been changed (so the number 6 will replace 5 in the exact same location on the screen 5 used to be sitting).

Hopefully I’ve made this clear enough. I went through a Java programming course in college and didn’t see this (not that courses cover every possible angle).

  • 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-12T16:44:23+00:00Added an answer on June 12, 2026 at 4:44 pm

    You can’t really do that with Java out-of-the box. The way Java interacts with the console is almost exclusively through streams. You can only ever append stuff to a (non-rewindable) stream, never overwrite or remove from it.

    There are a few exceptions in the case of the console, mostly found in the Console class, which allows a small amount of direct manipulation but doesn’t allow rewriting existing text either.

    You can do any of those things:

    • simply print the line again, leaving the old one above it
    • use a library like JCurses to take direct control of the output window
    • try to clear the console using an external command (cls or clear, depending on your OS)

    All but the first option require a medium amount of effort and add considerable complexity to your code, so you should only consider them if that feature is absolutely required.

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

Sidebar

Related Questions

Possible Duplicate: Unable to publish web service which is created in java using eclipse
Possible Duplicate: Create instance of “Class” Using “Reflection” in JavaScript Java has Class.forName(XYZClass) to
Possible Duplicate: How can I lock a file using java (if possible) I have
Possible Duplicate: Using LGPL library in a commercial Java application Hello guys! There is
Possible Duplicate: Using java to create a web browser Is there any way to
Possible Duplicate: Create XML file using java In Java to create the JSONObject {box:tissue,desk:wood}
Possible Duplicate: Not possible to launch a file on a network using Java Desktop?
Possible Duplicate: Pointers in java Why java is not using pointer though C# and
Possible Duplicate: Using SendMessage to enter text into an edit control belonging to another
Possible Duplicate: Using a bitwise & inside an if statement I have the following

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.