Lecture 14
4
TreeMap (1.5) summary
•declaration:                                                        TreeMap<KeyType, ValueType> mapName;
•creation:      new TreeMap<KeyType, ValueType> ( );
•put:                                                          mapName.put(KeyType key, ValueType val)
•get:  mapName.get( KeyType key)
•                         no cast to ValueType needed
•length:      mapName.size( )
•looping: for( KeyType key : mapName.keySet( ))    { // do whatever with key }
•
read as “in”