Veuillez consulter le code ci-dessous:
// A.class
File file = new File("blah.txt");
FileWriter fileWriter = new FileWriter(file);
PrintWriter printWriter = new PrintWriter(fileWriter);
// B.class
File file = new File("blah.txt");
FileWriter fileWriter = new FileWriter(file);
BufferedWriter bWriter = new BufferedWriter(fileWriter);
Quelle est la différence entre ces deux méthodes?
Quand devrions-nous utiliser PrintWriter sur BufferedWriter?