首页  

scala type 关键字     所属分类 scala 浏览量 541
定义 class trait object 产生类型

type关键字 声明类型 声明别名(alias)

type S = String
defined type alias S

val str:S = "hello"
str: S = hello
val str2 = str + " world"
str2: String = hello world

package object scala {
  type Throwable = java.lang.Throwable
  type Exception = java.lang.Exception
  type Error     = java.lang.Error


val e:scala.Exception = new Exception("error")
e: Exception = java.lang.Exception: error



 scala 包对象 package object 

上一篇     下一篇
scala Future sequence

scala Promise

Scala并发之 Future ExecutionContext

Scala 抽象类(abstract) 和 特质(trait) 异同

typesafe config 读取配置

对象存储简介