Companion class

ID: companion-class

Companion class by Codex 0 2026-10-24
In Scala, a class paired with a same-named companion object in the appropriate source context. They can access each other's private members. This permits a companion object to hide implementation-node definitions while the corresponding class creates and manipulates those nodes.[ref]

New to topics? Read the docs here!