Understanding what 'type' keyword does in Scala

后端 未结 4 1516
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-07 07:25

I am new to Scala and I could not really find a lot about the type keyword. I am trying to understand what the following expression may mean:

ty         


        
4条回答
  •  感情败类
    2020-12-07 08:04

    Just an example to see how to use "type" as alias :

    type Action = () => Unit
    

    The definition above defines Action to be an alias of the type of procedures(methodes) that take an empty parameter list and that return Unit.

提交回复
热议问题