码迷,mamicode.com
首页 > 其他好文 > 详细

scala类型系统 type关键字

时间:2017-06-18 23:34:44      阅读:309      评论:0      收藏:0      [点我收藏+]

标签:定义   system   object   ring   inf   fine   关键字   一个   code   

和c里的type有点像。

scala里的类型,除了在定义class,trait,object时会产生类型,还可以通过type关键字来声明类型。

type相当于声明一个类型别名:

scala> type S = String

defined type alias S

http://hongjiang.info/scala-type-system-type-keyword/

scala类型系统 type关键字

标签:定义   system   object   ring   inf   fine   关键字   一个   code   

原文地址:http://www.cnblogs.com/guazi/p/7045767.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!