2015-10-26 if-elseで変数代入 Scala www.atmarkit.co.jp val result = if(x == 0) "x is Zero" val result = if(x == 0) "x is Zero" else "hogehoge" こんな感じ。