• Post Reply Bookmark Topic Watch Topic
  • New Topic

key-class and value-class elements

 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In following code snippet



How could it possible to have a key of type int and value of type BigDecimal?
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the key and the value are 2 completely different objects. A Map is something that connects keys and values and provides the mechanism where when you supply the key its corresponding value object is returned.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!