1. 程式人生 > >scala:異常處理(try/catch)

scala:異常處理(try/catch)

處理語法:

try {
    // ...
} catch {
    case ex: Exception => {
        ex.printStackTrace() // 列印到標準err
        System.err.println("exception===>: ...")  // 列印到標準err
    }
}