scala的异常处理try catch
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") } } }
阿里云服务器:最高¥2000云产品通用代金券领取:
https://www.aliyun.com/minisite/goods?userCode=3ls0qk0b

浙公网安备 33010602011771号