I learned the PrintWritere class and the Scanner class
, the assignment is to turn a minor line style java program into a line end style
, or to replace all the substrings of "n {" in a java text file with "{"
, but the Scanner class does not rea dna t all and skips the character
, and even if I find it, I only learn that the PrintWriter class can write text in the new file after the old file. I simply do not know how to replace the original text
, so I can only create a new temporary text to write the modified content of the java file with the PringWriter object, delete the original file and rename the temporary file
. Is there a more convenient way to do this?