Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

Hashmap inside a Arraylist

hI,

I have a hashmap which has username and password information.
  Map mapDetail = new HashMap();
           mapDetail.put("username",username);
           mapDetail.put("password",password);
HashMap is embedded in a arraylist like below
  List missingList = new ArrayList();
 missingList.add(mapDetail);


I need to read the username and password information to send it to one other java program. How can I achieve it.Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
SOLUTION
Avatar of Sharon Seth
Sharon Seth
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

where can I find more of these kind of examples. I need to become more knowledgeable in this area of collection where passing 2D collection object into 1D collection object  and reading back again. please advise
My example should be more generic really:
      for (Map<String, String> m : maps) {
            for (Map.Entry<String, String> e : m.entrySet()) {
                String key = e.getKey();
                String val = e.getValue();
                System.out.printf("key=%s,value=%s\n", key, val);
            }
        }

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx 4 axxepting