Singleton Objects

Is a class that has exactly one instance. It is created lazily when it is referenced, like a lazy val. As a top-level value, an object is a singleton.

Singleton Objects → are a → Objects.

Defining a singleton object

object Box

An object is a value. The definition of an object looks like a class, but uses the keyword object.

Related concepts

Singleton Objects — Structure map

Clickable & Draggable!

Singleton Objects — Related pages: