The following code 'll create a file 'examplefile.txt',if doesn't exist
- try {
- // Create file if it does not exist
- boolean success = file.createNewFile();
- if (success) {
- // File did not exist and was created
- } else {
- // File already exists
- }
- e.printStackTrace();
- }
No comments:
Post a Comment