Reputation: 15581
I am using PrintWriter object
file as below:
PrintWriter pwriter = new PrintWriter("abc.txt");
Please let me know if a file name abc.txt
will be created if it doesn't exist.
I have tried it and it is not creating file. But i want to confirm if it is the expected not to create the file.
Upvotes: 2
Views: 4843
Reputation:
From the javadoc:
fileName - The name of the file to use as the destination of this writer. If the file exists then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.
Upvotes: 5