摘要:
一层嵌套,但是flatten的要求需要List内部类型都一样, 例如都为List scala> List(List(1), List(2), List(3)).flatten res4: List[Int] = List(1, 2, 3) scala> List(List(List(1)), Lis 阅读全文
posted @ 2023-03-10 23:10
Aitozi
阅读(141)
评论(0)
推荐(0)
摘要:
设想以下这个计算 def eval(i: Int): Option[Int] = { println(s"invoke with $i") if (i % 2 == 0) { None } else { Some(i + 1) } } @Test def test(): Unit = { // 3 阅读全文
posted @ 2023-03-10 22:57
Aitozi
阅读(47)
评论(0)
推荐(0)

浙公网安备 33010602011771号