异常

异常

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 @ 2019-08-30 06:16  会走的树  阅读(70)  评论(0编辑  收藏  举报