合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
Nothing 是所有类型的子类,也是 Null 的子类,含义便是<mark>啥都没有</mark>,所以没有任何实例。Nothing 有什么用? ```scala 1. 用于类型参数的自动推断 List(1)-> 类型为 List[Int] List("a",1)->类型可为 List[Any] List()-> List[Nothing] 2.可表示非正常退出 def e = throw new Exception("error message") 调用 e 将抛出异常,也是啥值都没有,所以就是 Nothing。 ```