标签:print logs each cat try code class ase lis
异常捕捉
scala> val a = Seq(1,2,3,6,4) a: Seq[Int] = List(1, 2, 3, 6, 4) scala> val b = a.map(f=>{ | try{ | Some(f/(f-1)) | }catch{ | case e:Exception=>None | } | }).foreach(println) None Some(2) Some(1) Some(1) Some(1) b: Unit = ()
标签:print logs each cat try code class ase lis
原文地址:http://www.cnblogs.com/huanhuanang/p/7286747.html