| Author |
put values in the TreeMap
|
umut uzumcu
Ranch Hand
Joined: Jan 10, 2007
Posts: 43
|
|
How can I put unique_number(key) , name(value), surname(value), addres(value) those information into the TreeMap? TreeMap takes 1 key and 1 value at a time, what is the way to put more value in the map for a key?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
No, Maps only support one value for a key. However, you can encapsulate your data in an object and store that instead of the three values.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
 |
|
|
subject: put values in the TreeMap
|
|
|