2017年2月27日

scala中的val与def

摘要: 在scala中,函数即对象,我们可以通过val来定义函数, 例如绝对值函数:def abs(x:Double)=if(x>0) x else -x 也可以如下定义: 运行结果: scalajavapython scalajavapython scalajavapython after update 阅读全文

posted @ 2017-02-27 11:02 taich-flute 阅读(3992) 评论(0) 推荐(0) 编辑

导航