标签:value cal var val illegal mat sqrt should except
var x= 10
if(x>=0){
scala.math.sqrt(x)
}else{
throw new IllegalArgumentException("the value should not be negative")
}
if else表达式的值为res1: Double = 3.1622776601683795
标签:value cal var val illegal mat sqrt should except
原文地址:http://www.cnblogs.com/liuye-micky/p/6910622.html