和c里的type有点像。
scala里的类型,除了在定义class
,trait
,object
时会产生类型,还可以通过type
关键字来声明类型。
type相当于声明一个类型别名:
scala> type S = String
defined type alias S
http://hongjiang.info/scala-type-system-type-keyword/
和c里的type有点像。
scala里的类型,除了在定义class
,trait
,object
时会产生类型,还可以通过type
关键字来声明类型。
type相当于声明一个类型别名:
scala> type S = String
defined type alias S
http://hongjiang.info/scala-type-system-type-keyword/
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。