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

  • Home
  • SEARCH
  • 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 8815235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:19:32+00:00 2026-06-14T04:19:32+00:00

I am working on a project in which I have to write a chat

  • 0

I am working on a project in which I have to write a chat client. For this project, we cannot use a UI and it must be written in Java. I haven’t used Java in quite some time so I find myself stuck trying to find the “Java” way to do something.

What I am trying to do is allow incoming data to be processed and printed to the console but at the same time allowing for input. I know it is not a simple task (or sometimes even possible) to have simultaneous non-blocking input/output, but luckily this isn’t exactly what I am looking for either. The best way to describe what I want is the ability to let output to be processed and displayed and printed until user input begins.

I know this can be done in C/C++ with a switch statement, but as far as I have found there is no equivalent in Java. I have come across the nio package, and have begun reading through it, but to no avail yet so far.

What are some suggestions on how best to perform this task using Java’s toolset? Also, apologies if this isn’t clear, I am having a difficult time putting my desires into words.

  • 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-14T04:19:33+00:00Added an answer on June 14, 2026 at 4:19 am

    So in the end I ended up going with the information found in this post in Graham King’s blog. In addition to this I used a single thread to queue incoming data, and then print them once the input was finished.

    Incoming data is printed to the screen until user input begins, then it pauses, and all data received during the time that user input is happening is then displayed when user input ends.

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

Sidebar

Related Questions

I have been working on a Java project in which the reports will be
I am working on this application for which we have to write framework services
I'm working on a project in which we have a database, data layer (entity
hello all i am working on a project in which i have a webpage
My problem/issue We are working on an opensource project which we have hosted on
I'm working on a project which will end up have a lot of application
I have just begun working on a project which uses Mercurial as a version
I have started working on a project which requires Natural Language Processing. We have
I am working on a hobby project in which I have to crawl different
I have a project which I am working on and it has multiple files

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.