Solved

How to diplay the values in HashMap?

Posted on 2004-10-29
268 Views
Last Modified: 2010-03-31
How to diplay the values in HashMap?

Thanks.
0
Question by:jen2483
    3 Comments
     
    LVL 13

    Expert Comment

    by:petmagdy
    0
     
    LVL 14

    Accepted Solution

    by:

            Set set=map.keySet();
            Iterator iterator=set.iterator();
            while(iterator.hasNext())
            {
                Object key=iterator.next();
                System.err.println("Key : "+key);
                System.err.println("Value :"+map.get(key));
            }
    0
     
    LVL 86

    Expert Comment

    by:CEHJ
    System.out.println(map);
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One Java Help from Top Experts

    Solve your toughest problems, fast.
    Java experts are online now and ready to help you.

    Suggested Solutions

    1. Package the applet into a JAR file. The applet must be in a JAR file before a certificate can be attached to it. Use the jar JDK utility. If the applet was previously referenced with the help of a codebase attribute in  tag, replace the codebase …
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now