I want to copy the content of file \'A\' to file \'B\'. after the copying is done I want to clear the content of file \'A\' and want to write on it from its beginning. I can
I don't believe you even have to write an empty string to the file.
PrintWriter pw = new PrintWriter("filepath.txt"); pw.close();