摘要:
/** * Created by root * Description : 递归函数 */ object RecursionTest { def main(args: Array[String]): Unit = { // a到b的累加 def foo(a:Int,b:Int):Int ={ if (a > b) 0 else a + f... 阅读全文
posted @ 2017-12-06 11:08
麻雀虽小五脏俱全
阅读(340)
评论(0)
推荐(0)
摘要:
/** * Created by root * Description :CallByValue:进入函数就得先计算实参的值;CallByName:函数体重使用到的时候才计算 */ object CallByValueAndCallByName { def main(args: Array[String]): Unit = { val c = add(1+2,3) ... 阅读全文
posted @ 2017-12-06 11:07
麻雀虽小五脏俱全
阅读(676)
评论(0)
推荐(0)

浙公网安备 33010602011771号