object Test { def main(args: Array[String]) { try { val f = new FileReader("input.txt") } catch { case ex: FileNotFoundException =>{ println("Missing file exception") } case ex: IOException => { println("IO Exception") } } }
scala的异常处理try catch
猜你喜欢
转载自www.cnblogs.com/hhz-97/p/12953097.html
今日推荐
周排行