SyntaxFix
Write A Post
Hire A Developer
Questions
Use:
File f = new File("C:\\a\\b\\test.txt"); f.mkdirs(); f.createNewFile();
Notice I changed the forward slashes to double back slashes for paths in Windows File System. This will create an empty file on the given path.