Silakan lihat kode di bawah ini:
// 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);
Apa perbedaan antara kedua metode ini?
Kapan kita harus menggunakan PrintWriter melalui BufferedWriter?