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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:02:58+00:00 2026-06-07T04:02:58+00:00

Sample data store in hashmap is as , e.g. {client1-data1:data1,client2-data2:data2,client3-data3:data3,client4-data4:data4,client1-data2:data2,client2-data1:data1,client3-data4:data4,client4-data3:data3} every data can be

  • 0

Sample data store in hashmap is as ,

e.g.
{“client1-data1″:data1,”client2-data2″:data2,”client3-data3″:data3,”client4-data4″:data4,”client1-data2″:data2,”client2-data1″:data1,”client3-data4″:data4,”client4-data3”:data3}

every data can be get repeated for every other client , the key will be unique as client1-data1 combination value will get repeated but key will be unique.

Issue for handling multiple clients,

for every user , a different thread is created while making a connection so every thread will created a PrintWriter object which gets added to a Arraylist

List writers = new ArrayList();

Is their anyways where i can store the client_id along with the Printwriter object in the same array and pass the data to clients while filter the data with that client id as stored in the Hashmap in the above example.

PLease do reply/suggest

thanks,
Praveen T

  • 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-07T04:02:59+00:00Added an answer on June 7, 2026 at 4:02 am

    You can use a collection which stores a pair of elements. A round about way of doing this is to use a Map.

    Map<PrintWriter, String> writeAndClientId = new HashMap<>();
    

    You can loop over these using

    for(Map.Entry<PrintWriter, String> entry: writeAndClientId.entrySet())
    

    If you want to be able to get one clientId at a time you can use

    Map<String, PrintWriter> clientIdToWriter = new HashMap<>();
    
    PrintWriter pw = clientIdToWriter.get(clientId);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sample data: I can flatten out parent-child relationship using this query.... Any help... Thanks
Sample HTML Data <body style=width:300px;> <h3>Long-Text</h3> A simple tool to store and display texts
I am using the Music Store sample data and I have a POCO like
I have an sample application where i am binding the store data to the
So I'm writing a Java application that uses Simple to store data as xml
I'm looking for a simple solution using Python to store data as a flat
I'm trying to save some specific JSon data and store them in a simple
I am looking for a good data-structure to store a simple key value mapping,
My question is really simple, I fetch data from database and store them as
Sample Data: 603 Some garbage data not related to me, 55, 113 -> 1-ENST0000

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.