和c里的type有点像。
scala里的类型,除了在定义class
,trait
,object
时会产生类型,还可以通过type
关键字来声明类型。
type相当于声明一个类型别名:
scala> type S = String
defined type alias S
http://hongjiang.info/scala-type-system-type-keyword/
本文共 235 字,大约阅读时间需要 1 分钟。
和c里的type有点像。
scala里的类型,除了在定义class
,trait
,object
时会产生类型,还可以通过type
关键字来声明类型。
type相当于声明一个类型别名:
scala> type S = String
defined type alias S
http://hongjiang.info/scala-type-system-type-keyword/
转载于:https://www.cnblogs.com/guazi/p/7045767.html