Sunday, 11 August 2013

How does Scala java conversion work?

How does Scala java conversion work?

If I have java.util.List and want to iterate over it user Scala syntax I
import :
import scala.collection.JavaConversions._
and the java.util.List is implicitly converted to
scala.collection.mutable.Set
(http://www.scala-lang.org/api/current/index.html#scala.collection.JavaConversions%24)
But how is this conversion achieved ? I'm confused as this is the first
time I've encountered the ability to convert an object type by just
importing a package.

No comments:

Post a Comment