概要
デフォルト値が指定してあるとその引数は省略できる。
コード
Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45). Type in expressions to have them evaluated. Type :help for more information. scala> def show(message:String = "hello", count:Int = 1) = { | var i = 0 | while (i < count) { | println(message) | i += 1 | } | } show: (message: String, count: Int)Unit scala> show() hello scala> show(count = 2) hello hello scala> show(message = "bye", count = 3) bye bye bye