kotlin 之单表达式函数

   fun d(x:Int):Int=x*2

如果函数体只有一条语句,而且是return语句,那么可以省略大括号以及return关键字,

猜你喜欢

转载自www.cnblogs.com/loaderman/p/10143944.html
今日推荐