O'Reilly logo
  • Curtis Turner thinks this is interesting:

n this case you’re importing the Random class defined in the scala.util package in the Scala code block, and it’s lexically scoped inside the block and won’t be available outside it. Because the Scala package is automatically imported to all Scala programs, you could rewrite the block by relatively importing the util.Random class:


Cover of Scala in Action


Relevance: http://stackoverflow.com/questions/5769941/scala-where-should-i-place-import-statements