| Author |
HashMap in HashMap Doubts
|
Micheal John
Ranch Hand
Joined: Nov 01, 2006
Posts: 344
|
|
Hi all, I'm using HashMap to store data in key/value pair: below is what I'm doing.. I want to get for the key 100 and 01, the value is Hello and 100 and 02, the value is World.. How to achieve this..is there any api for this..or we have to use like StringTokenzier..?
|
Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
|
 |
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
|
|
|
returns a HashMap, so just iterate through that the same way as you iterated thru h3.
|
Joanne
|
 |
Edwin Dalorzo
Ranch Hand
Joined: Dec 31, 2004
Posts: 961
|
|
Do you mean somewhat like this?
|
 |
Micheal John
Ranch Hand
Joined: Nov 01, 2006
Posts: 344
|
|
|
It's seems to be generics.. only supported in 1.5..? i am using i.4..?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
The logic will be the same though. 1.4 version:
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Micheal John
Ranch Hand
Joined: Nov 01, 2006
Posts: 344
|
|
Thanks paul, Edwin and also neal..
|
 |
Edwin Dalorzo
Ranch Hand
Joined: Dec 31, 2004
Posts: 961
|
|
The logic will be the same though. 1.4 version:
Did you not miss the casting, Paul?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Yup Teach me for just regexing out the generics syntax...
|
 |
 |
|
|
subject: HashMap in HashMap Doubts
|
|
|