import java.util.*; public class ExampleTreeMap { public static void main(String args[]) { TreeMap tm = new TreeMap(); tm.put("Cilka", new Double(3434.34)); tm.put("Julka", new Double(123.22)); tm.put("Barbara", new Double(1378.00)); tm.put("Ana", new Double(99.22)); tm.put("Rezika", new Double(-19.08)); Set set = tm.entrySet(); Iterator i = set.iterator(); while(i.hasNext()) { Map.Entry me = (Map.Entry)i.next(); System.out.print(me.getKey() + ": "); System.out.println(me.getValue()); } System.out.println(); double racun = ((Double)tm.get("Ana")).doubleValue(); tm.put("Ana", new Double(racun + 1000)); System.out.println("Ana ima na računu: " + tm.get("Ana")); } }