Witam, mam mapę typu <Char, Int> i chcę wyłuskać z niej te chary. Próbowałem iteratorem.
Iterator it = this.dictionary.entrySet().iterator();
while(it.hasNext()) {
Map.Entry pairs = (Map.Entry)it.next();
char c = pairs.getKey();
//if(this.probabilityMap.get(pairs.getKey()) == null)
// this.probabilityMap.put(pairs.getKey(), 10.2);
it.remove(); //unikniecie jakiegos exceptiona
}
Nie wiem czemu pairs.getKey() jest typu Object skoro gdy go printlnuję to dostaję chary. Konwersja też nie pomaga.