[Logo]
Forums Register Login
what does entrySet return??
it returns a set.

so does it contain both the 'key' and 'value' in case of hashmap??
If you take a look at the API documentation for the Map.entrySet() method it should be pretty obvious what exactly is returned.
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.
rubbery bacon. crispy tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 1640 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 16, 2018 03:01:46.