带资源的try语句(try-with-resource)的最简形式为:
try(Resource res = xxx)//可指定多个资源 { work with res }
try块退出时,会自动调用res.close()方法,关闭资源。