Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
How to implemnt dupplicate key map...
Joined: Dec 03, 2008
Jan 21, 2011 03:01:15
Please can any one guide me to implement map with duplicate key?
Joined: Jan 18, 2011
Jan 21, 2011 03:15:14
I would suggest you check the following link.
Hope that helps!
Joined: Oct 13, 2005
Jan 21, 2011 03:20:08
That is a contradiction in terms. A map represents a function, and a function cannot have duplicate results from one input.
It is easy to have duplicate values.
Map<Name, Forum> moderators = new HashMap<Name, Forum>(); . . . Forum beginning = new Forum("Beginning Java"); moderators.put(new Name("Campbell Ritchie"), beginning); moderators.put(new Name("Janeice del Vecchio"), beginning)
. . . will work, but this wont't:
Map<Name, Forum> moderators = new HashMap<Name, Forum>(); . . . Forum beginning = new Forum("Beginning Java"); Forum bunkhouse = new Forum("Bunkhouse Porch"); Name campbell = new Name("Campbell Ritchie); moderators.put(campbell, beginning); moderators.put(campbell, bunkhouse)
you will ony ever get Bunkhouse Porch out of that Map.
subject: How to implemnt dupplicate key map...
Hibernate with 2 column id
Problem about EL ....
LinkedHashMap in html:options
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013