How to provide default values for Scala constructor parameters
By Alvin Alexander. Last updated: April 1 2018
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 4.5, “How to provide default values for Scala constructor parameters.”
Problem
You want to provide a default value for a Scala constructor parameter, which gives other classes the option of specifying that parameter when calling the constructor, or not.