Declarations

Not all programs are single expressions. Sometimes it is useful to bind expressions to a name and re-use them later. These constructs are called declarations. Declarations themselves don't have a type or a value. However, they do bind names that can be used as expressions. There are several types of declaration in Scala as we shall see below.

Extended Exercise: Color Palettes→