| Author |
what does entrySet return??
|
yuvraj kotegar
Ranch Hand
Joined: Jul 31, 2008
Posts: 120
|
|
it returns a set. so does it contain both the 'key' and 'value' in case of hashmap??
|
 |
Jelle Klap
Bartender
Joined: Mar 10, 2008
Posts: 1409
|
|
|
If you take a look at the API documentation for the Map.entrySet() method it should be pretty obvious what exactly is returned.
|
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
Yuvraj, Yes. The JavaDoc for Java 5+ shows this a bit more clearly. It says the return type is: Set<Map.Entry<K,V>> This is a Set of Entry objects. The Entry class is defined within Map and has the key/value pairs.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: what does entrySet return??
|
|
|