Type parameters applied to Scala Function

后端 未结 6 1011
遇见更好的自我
遇见更好的自我 2021-01-23 08:35

I am trying to understand the type parameters when applied to a function.

I would like to use Generic Types in the below method but using String and Int for my understa

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 09:07

    A quick one liner:

    def myfunc(f:String => Int):Int = Integer.min(1,2)
    

提交回复
热议问题