Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class DemoApplication {
public static void main(String[] args) throws IOException {
// 空ファイルの格納先を設定する
Path path = Paths.get("/tmp/empty.txt");
try {
// 空ファイルを作成する
Files.createFile(path);
} catch (FileAlreadyExistsException exception) {
System.out.println("ファイルが既に存在しています。" + exception.getMessage());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.