Back to Developer Roadmap

package

src/data/roadmaps/scala/content/package@RVwd5ZY4e_RUhsIi1NZFu.md

4.0804 B
Original Source

package

The package keyword is used to create namespaces that can contain entities such as classes, objects, and other packages. In Scala 2, package objects allow defining functions, variables, and types that are accessible to all members of a package. In Scala 3, it's possible to define all those elements at the top-level, so there is no longer any need to declare package objects.

Visit the following resources to learn more: