摘要: /** * 2.递归方法 * 递归方法要显式的声明函数的返回值类型 def fun(num:Int):Int={ if (num==1) { 1 } else { num*fun (num-1) } } printIn(fun(num =5)) /** * 3.参数有默认值的方法 def fun ( 阅读全文
posted @ 2022-05-14 23:26 迟' 阅读(26) 评论(0) 推荐(0)