异常书写方式
异常书写方式包含:“try-catch-finally"和"try-with-resources”
1.“try-catch-finally”
public static void writeFile(Path path, String content) {
BufferedWriter writer = null;
try{
writer = Files.newBufferedWriter(path, StandardCharsets.UTF_8
原创
2021-10-22 11:39:10 ·
254 阅读 ·
0 评论