Map
hm.put("1","Luis");
hm.put("2","Amaya");
hm.put("3","Julio");
Recorrer MAP
Iterator it = hm.entrySet().iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry)it.next();
System.out.println(e.getKey() + " " + e.getValue());
}
Ver Link con explicación en:
http://lineadecodigo.com/java/listar-un-mapa-con-java-util/
No hay comentarios:
Publicar un comentario