Cuál es la forma más fácil de iterar sobre todos los pares clave/valor de un java.útil.Mapa en Java 5 y superior?
Cuál es la forma más fácil de iterar sobre todos los pares clave/valor de un java.útil.Mapa en Java 5 y superior?
30
1 answers
Suponiendo que K
es su tipo de clave y V
es su tipo de valor:
for (Map.Entry<K,V> entry : map.entrySet()) {
K key = entry.getKey();
V value = entry.getValue();
// do stuff
}
70
Author: Joachim Sauer,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-02-25 11:39:26
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-02-25 11:39:26