On the up side, the put method does return the previous value. So if you get a null returned, you know you didn't overwrite something. But if you do replace another mapping, the old value is returned.
Steven Leow
Greenhorn
Joined: Jun 19, 2001
Posts: 6
posted
0
How is the hasttable used in a chat program? I mean the Key contains what? and the Values contains what? From what i know they contains things which enables the server to "look" for the clients...
karl koch
Ranch Hand
Joined: May 25, 2001
Posts: 388
posted
0
hi, there are lot of things to do with hashtables. what is it your looking for ? do you have a specific problem ? you could use it to "map" a username to the ip/port (eg. for whsipering to a special user).