val max = if (a > b) { print("Choose a") a } else { print("Choose b") b }
注意和java代碼的區別java
if的分支能夠是代碼塊,最後的表達式做爲該塊的值spa