| Author |
Need to store the result obtained within a while loop for further usage
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hi ,
Inside a while loop , i am obtaining a result Hashmap as shown
I am passing this LinkedHashMap "hmTxn" to another Method for some data Formation , by which i obtain a hashmap .
Please let me know how can i store the returned HashMap "hmTxnForFox" so that i can have its values outside the while loop .
If i use list.add(hmTxnForFox) , i am getting only the last value . I want to have all the result outside the while loop
Please help .
|
Save India From Corruption - Anna Hazare.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
|
Why can't you just create a variable outside the loop?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
really i am struck up badly with this . could you please explain what you said.
Thank you very much .
|
 |
Rene Larsen
Ranch Hand
Joined: Oct 12, 2001
Posts: 1179
|
|
If you put a List outside the while loop you can add hmTxnForFox to it - and then after the while loop is ended you have a List with the found LinkedHashMap.
|
Regards, Rene Larsen
Dropbox Invite
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
I was in tense yesterday and i couldd't point out this .
Thank you very much .
|
 |
 |
|
|
subject: Need to store the result obtained within a while loop for further usage
|
|
|