- 链接地址:https://blog.csdn.net/m0_58535137/article/details/122805592
- 链接标题:scala模式匹配之类型匹配_scala 模式匹配数据类型类型-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:6521
文章浏览阅读248次。object 类型匹配 { def main(args: Array[String]): Unit = { val a: Any = "hadoop" val result = a match { case x: String => s"${x}是一个String类型的数据" case x: Int => s"${x}是一个Int类型的数据" case x: Double => s"${x}是一个Double类型的数据" _scala 模式匹配数据类型类型
版权声明:本文发布于特牛网址导航 内容均来源于互联网 如有侵权联系删除