title: What is the collection that HashMap.values() method in Java returns?
body: <p>Java SE 6.0 API says <code>values()</code> method in <code>java.util.HashMap</code> returns a <code>Collection</code> type. How does JVM decide which collection to return at run time. Is it jvm specific or are there any general guidelines that Java follows. I browsed the source-code of <code>HashMap</code> but couldn't get a clue. Any help is highly appreciated, or if the question is lame, kindly point me why.Thanks.</p>