📜  尝试捕获 kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:32.792000             🧑  作者: Mango

代码示例2
try{
  // wirte here somethin that you thought it would throw expection
}
catch(e:Expection){ 
  e.printstacktrace() 
  // handle expection or write upper line of code
}
finally{
    // this block is optional 
      // this will always run if expection come or not
}