I would like to know the difference in these two methods of writing to files.
Path path = Paths.get("E:/documentos/texte.txt");
Charset utf8 = StandardCharsets.UTF_8;
try(BufferedWriter escrever = Files.newBufferedWriter(path, utf8)) {
escrever.write(" ");
}
For this:
File arq = new File("E:/documentos.texte.txt");
FileWriter fw = new FileWriter(arq);
try(BufferedWriter escrever = new BufferedWriter(fw)) {
escrever.write(" ");
}