Home | Login | Blog | Forum | Download | RSS Feed | Ajax | Hello-World | J2EE | BPM | EJB | FileNet | Hibernate | ORM | IBM | ILOG | Interview | FAQs |

Java | Apache | JVM | Others | BRMS | Oracle | Pega | SOA | Sun-Certification | Web-Service | websphere | XML |
 

JAVA DEVELOPER SITE - COMPLETE JAVA TUTORIALS

Java Iterate a HashMap, Iterate Map in Java, Source Code Iterate Map in Java


Share
 
 

Useful Java Links


       


Iterate HashMap in Java:

HashMap is widely used across java and J2EE application to handle key value pairs. With the introduction of Generics in JAVA 1.5, HashMap becomes more important and can contains a set of predefined key and values. An example in given below:

HashMap<Integer, ArrayList<String>> custDataKey = new HashMap<Integer, ArrayList<String>> custDataKey();

In the above example, we have a HashMap with Integer as a key and an ArrayList of strings as a value. Note that, the Value is again a collection of type String.

In order to Iterate the above Map, we use the below line of code:

HashMap<Integer, ArrayList<String>> custDataKey = new HashMap<Integer, ArrayList<String>> custDataKey();


Iterator< Map.Entry< Integer,ArrayList<String>>> securityEnt=guaranteeMap.entrySet().iterator();

while(securityEnt.hasNext()){

Map.Entry< Integer,ArrayList<String>> aSecuritySummaryMap=securityEnt.next();


int rowIndex=aSecuritySummaryMap.getKey();

ArrayList<String> secRowVal=aSecuritySummaryMap.getValue();

}

This way, we can easily iterate over a hashmap in java.




Download Latest Java/J2EE eBooks, SCJP Dumps, SCWCD Dumps, Pega Tutorial, IBM WebSphere BPM tutorials and many more


If you need any urgent assistance on iterate-hashmap-in-java-tutorial, kindly email your requirement to us at : info@javagenious.com or Contact-an-Expert. Our experts will try their best to solve your problem.

You can also subscribe to our newsletters on iterate-hashmap-in-java-tutorial, to receive updates on iterate-hashmap-in-java-tutorial,via email.Enter you email below:

Enter your email address:

Delivered by FeedBurner



Keyword Tags: iterate-hashmap-in-java-tutorial tutorial,iterate-hashmap-in-java-tutorial in java,Concepts of iterate-hashmap-in-java-tutorial,Java,J2EE,Interview Questions,iterate-hashmap-in-java-tutorial Examples


Comments:

  1. Leo Nan says:

    Thanks for the info.

  1. Ali says:

    Thanks , this works well for me and solved my problem.


Post Your Comment:

*

Yes, I would like to recieve email notifications on my reply.

Popular Posts:

 
Popular Downloads

SCJP 1.6 Dumps
JSP Interview Questions
Struts Interview Questions
Hibernate Interview Questions
SCWCD Dumps
SCBCD Dumps

Java/J2EE Tutorial
JMS Tutorials
seam richfaces tutorial
richfaces live demo
jquery example demo
JQuery Tutorial and Source Code
JSF Tutorial
XSL Tutorial
J2EE JMS
CORBA Applications
Java CERTIFICATION
SCJP 1.5
SCJP 1.6
SCWCD 1.5
SCBCD
Mis
Ajax autosuggest autocomplete from database
Struts forms and validation with webflow
Java Apache POI Examples
JDBC Tutorial
Oracle 9i & 10g
MYSQL Tutorial
php Tutorial
JQuery Examples
Upload Java File
JAXB Examples
PL-SQL Tutorial
Dojo AJAX
EJB Examples
Java IDE
Eclipse
NetBeans
IBM Rational Weblogic Workshop
Downloads
SCJP 1.6 Dumps
SCJP 1.5 DUMP
SCJP Material
SCWCD
Java Security
SCBCD Dumps
External Links
SUN Java
JOracle
IBM
PHP Certification
Technical Interview Questions
Amazon Interview Questions
Google Interview Questions
Microsoft Interview Questions
IBM Interview Questions
Yahoo Interview Questions
All Tutorials
php mysql tutorial
SCJP 1.5/1.6
SCWCD 1.5/1.6
Polymorphism
Thread Tutorial
Generics & Exceptions
Spring Struts Hibernate
Java Collections
MAP
SET
LIST
VECTOR
Advanced Java
Stateless Session Bean
Introduction to EJB
Stateful Session Bean
Java Design Patterns
HOME | FORUM | ABOUT | BLOGS | CONTACT-US