Results 1 to 4 of 4
Thread: Update Value Hashtable
- 03-11-2012, 05:49 PM #1
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
Update Value Hashtable
Well i dont really know very much about java. I´m learning. I have a to do a hashmap with teams and their score so..
i have this
public class Clasi {
Hashtable<String , Integer> scores = new Hashtable<String, Integer>();
public Clasi(ArrayList<Team> teams){
Iterator<Team> it=teams.iterator();
while (it.hasNext()){
clasi.put(it.next().getName(), 0);
}
}
Now i want to know how to iterate the hashtable and update the values when i have new scores. Thx..
- 03-11-2012, 07:08 PM #2
Re: Update Value Hashtable
Read the API doc for the Hashtable class. It has methods that you can use to go throught the hashtables contents.how to iterate the hashtable
-
Re: Update Value Hashtable
Are you using a HashMap or a HashTable?
And how exactly are you getting data to do the updating?
- 03-11-2012, 07:22 PM #4
Member
- Join Date
- Mar 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Hashtable question. Getting info from a hashtable
By sindrem in forum New To JavaReplies: 4Last Post: 01-19-2012, 05:00 PM -
hashtable
By vijayabaskar in forum Java ServletReplies: 0Last Post: 04-06-2009, 08:20 AM -
hashtable
By vijayabaskar in forum Advanced JavaReplies: 2Last Post: 04-06-2009, 08:05 AM -
Hashtable
By angelicsign in forum New To JavaReplies: 6Last Post: 02-05-2009, 04:30 PM -
Hashtable example
By Java Tip in forum Java TipReplies: 0Last Post: 02-15-2008, 08:43 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks