ciao!
avrei una domanda sull'ordinamento di iterazione di HashMap.
codice:
HashMap<String, String> sheetsMap = new HashMap<String, String>();
sheetsMap.put("ENTRATE", Const.LOCAL_PATH + Const.JSON_LAST_ENTRIES);
sheetsMap.put("USCITE", Const.LOCAL_PATH + Const.JSON_LAST_RELEASES);
Iterator<Entry<String, String>> it = sheetsMap.entrySet().iterator();
while (it.hasNext()) {
@SuppressWarnings("rawtypes")
Map.Entry entry = (Map.Entry) it.next();
System.out.println(entry.getKey().toString() + entry.getValue().toString());
}
i valori vengono stampati partendo da USCITE, sia che metto questa chiave all'inizio della lista che alla fine.
potreste spiegarmi il perchè e in caso come potrei risolvere??