Scala Language Scope Public (default) scope


Example

By default, the scope is public, the value can be accessed from anywhere.

package com.example {
  class FooClass {
    val x = "foo"
  }
}

package an.other.package {
  class BarClass {
    val foo = new com.example.FooClass
    foo.x // <- Accessing a public value from another package
  }
}