try{
File file = new File(\"write.txt\");
FileWriter writer = new FileWriter(file);
PrintWriter printWriter = new PrintWriter(writer);
printWriter.prin
PrintWriter
gives you some handy methods for formatting like println
and printf
. So if you need to write printed text - you can use it. FileWriter
is more like "low-level" writer that gives you ability to write only strings and char arrays. Basically I don't think there is a big difference what you choose.