package
Last updated
What is 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.
Free resources to learn package
More in stage 13: Scope & Visibility
package: common questions
Can I learn package in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain package in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this package tutorial for beginners?
It is lesson 71 of 165 in the free Scala roadmap, in stage 13, Scope & Visibility. If you are new to Scala, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.