every function in scala is an instance of a class
生活随笔
收集整理的這篇文章主要介紹了
every function in scala is an instance of a class
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Created by Wang, Jerry, last modified on Jan 11, 2016
object MainFunction0Test extends App { val suc = (x:Int)=> x + 1 val sud = new Function1[Int, Int] { def apply(x:Int): Int = x + 1 } assert(suc(0) == sud(0)) }
myInt即為形參。
another way:
Since in Scala you can use type inference you don’t have to declare the type so the following would be equivalent:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的every function in scala is an instance of a class的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用xsodata文件将SAP HANA
- 下一篇: 堪比十年老司机!曝问界M7也有智驾版:无