944,116 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 468
  • Java RSS
Oct 29th, 2009
0

Can you use Strings as 'values' in a hashtable?

Expand Post »
Pretty much what the title says!! Basically I want to store method generated Strings and then plug them into another method - would hashtable be a way to do this??

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
skiplatte is offline Offline
10 posts
since Oct 2009
Oct 29th, 2009
0
Re: Can you use Strings as 'values' in a hashtable?
Strings can, of course be values in a hastable, but what does that have to do with the rest of the question?

What do you mean by "method generated Strings" and "plug them into another method"?

Also, whatever it is, HashMap would probably be a better choice than Hashtable, unless you have some specific reason for synchronizing access to it.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Oct 29th, 2009
0
Re: Can you use Strings as 'values' in a hashtable?
Strings can, of course be values in a hastable, but what does that have to do with the rest of the question?

What do you mean by "method generated Strings" and "plug them into another method"?

Also, whatever it is, HashMap would probably be a better choice than Hashtable, unless you have some specific reason for synchronizing access to it.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Oct 29th, 2009
0
Re: Can you use Strings as 'values' in a hashtable?
Click to Expand / Collapse  Quote originally posted by masijade ...
Strings can, of course be values in a hastable, but what does that have to do with the rest of the question?

What do you mean by "method generated Strings" and "plug them into another method"?

Also, whatever it is, HashMap would probably be a better choice than Hashtable, unless you have some specific reason for synchronizing access to it.
Basically I have a method (tokenizer, but thinking about looking at regex) which splits an input string into smaller strings are r and k and i want to be able to used those substrings to calculate the mass of them (from values stored in a hashmap). So probably thinking about it I'll need to make an array of substrings?

Thanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
skiplatte is offline Offline
10 posts
since Oct 2009
Nov 3rd, 2009
0
Re: Can you use Strings as 'values' in a hashtable?
I have no idea what you are talking about.

Maybe you should provide a bit of a sample of the data you start with and then a detailed explanation of what you are doing with it (showing the modifications to that data).
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: printing in passbook using swing
Next Thread in Java Forum Timeline: how to output the result in jframe





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC