• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

put values in the TreeMap

 
umut uzumcu
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic