For your convenience,
whenever you compile code, the Scala compiler automatically imports the
definitions in the
javac does this, too). On the .NET platform, it
system package. The compiler also imports
the definitions in the analogous Scala package,
Hence, common Java or .NET types can be used without explicitly importing
them or fully qualifying them with the
prefix, in the Java case. Similarly, a number of common, Scala-specific
types are made available without qualification, such as
List. Where there are Java and Scala type names that
String, the Scala version is imported
last, so it “wins.”
The compiler also
automatically imports the
Predef object, which defines
or imports several useful types, objects, and functions.
You can learn a lot of Scala by viewing the source for
Predef. It is available by clicking the “source” link
Predef Scaladoc page, or you can download the
full source code for Scala at http://www.scala-lang.org/.
Table 7-1 shows a partial list of the items imported or
Predef on the Java platform.
Table 7-1. Items imported or defined by Predef