import collection.JavaConversions._ val h = getJavaHashMapFromSomeWhere() for (e <- asScalaSet(h.entrySet())) { System.out.println(e.getKey() + " = " + e.getValue()) }
Programming Tips - Scala: How do I iterate through all keys/values of a HashMap
Date: 2013may27
Language: Scala
Keywords: enumerate
Q. Scala: How do I iterate through all keys/values of a HashMap
A. Use asScalaSet() like this: