Thursday, August 19, 2010

Scala wrappers for java collection


import scala.collection.JavaConversions._

System.getProperties.foreach(println)


Please note that the java method System.getProperties() returns java.util.Properties. There is no foreach defined in that class. Behind the scene, scala.collection.JavaConversions defines implicit conversions that converts java collections to scala collections.

No comments: