J'ai le code suivant qui ajoute des tableaux à un hashmap mais je veux accéder à ces tableaux pour y travailler plus tard. Je suis arrivé jusqu'ici mais ne peut pas comprendre le reste à le faire fonctionner ....Valeurs Hashmap Java pour Array
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
public static void main(String[] args) {
String[][] layer1 = {
{"to1", "TYPE1", "start"},
{"to2", "TYPE1", "start"}
};
String[][] layer2 = {
{"to3", "TYPE2" ,"item1"},
{"to3", "TYPE2" ,"item2"}
};
HashMap<String,Object> hashMap = new HashMap<String,Object>();
hashMap.put("layer1", layer1);
hashMap.put("layer2", layer2);
Iterator<Entry<String, Object>> iterator = hashMap.entrySet().iterator();
while(iterator.hasNext()){
hashMap.values().toArray();
for (???) {
// lets print array here for example
}
}
}
pas de devoirs ... il suffit de mélanger trop de langues pour apprendre l'atm :) Merci! – EddyR