Chapter 7. Packages and Imports

Topics in This Chapter image

7.1 Packages — page 74

7.2 Scope Rules — page 75

7.3 Chained Package Clauses — page 77

7.4 Top-of-File Notation — page 77

7.5 Package Objects — page 78

7.6 Package Visibility — page 78

7.7 Imports — page 79

7.8 Imports Can Be Anywhere — page 80

7.9 Renaming and Hiding Members — page 80

7.10 Implicit Imports — page 80

Exercises — page 81

In this chapter, you will learn how packages and import statements work in Scala. Both packages and imports are more regular than in Java; they are also a bit more flexible.

The key points of this chapter are:

• Packages nest just like ...

Get Scala for the Impatient now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.