Quantcast
Channel: default
Viewing all articles
Browse latest Browse all 10

How to provide default values for Scala constructor parameters

$
0
0

How to provide default values for Scala constructor parameters

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.


Viewing all articles
Browse latest Browse all 10

Trending Articles