异常

异常

try {
val result = 5 / 0
println("---->")
} catch {
case e: Exception => e.printStackTrace()
case _ => println("other Exception!")
} finally {
println("end")
}
java.lang.ArithmeticException: / by zero
at base.file_Out_In$.main(file_Out_In.scala:17)
at base.file_Out_In.main(file_Out_In.scala)
end
posted @   会走的树  阅读(71)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示