Each element is a map has a key and value. Each key-value pair is saved in a
Assume in the following table that
java.util.Map.Entry
object. A set of these map entries can be obtained by calling a map's entrySet()
method. Iterating over a map is done by iterating over this set. Assume in the following table that
me
is a Map.Entry
object. Result | Method | Description |
---|---|---|
obj = | me.getKey() | Returns the key from the pair. |
obj = | me.getValue(key) | Returns the value from the Map pair. |
obj = | me.setValue(val) | This is an optional operation and may not be supported by all Map.Entry objects. Sets the value of the pair, which modifies the Map which it belongs to. Returns the orginal value. |
No comments:
Post a Comment