2010-05-24から1日間の記事一覧

メソッドの戻り値推論

これは普通に戻り値 4 def method() = { 2 * 2 } println(method) // 4 これも戻り値 4 def method() = 2 * 2 println(method) // 4 こうするとUnit def method() { 2 * 2 } println(method) // () こうすると当然戻り値 4 def method():Int = { 2 * 2 } pri…