Writing a formatted string to a file - Java
问题 I have a string that I format with the System.out.format() method, I do something like : System.out.format("I = %3d var = %9.6f", i, myVar); but when I try to write this formatted string into a file, I only get something like "java.io.PrintStream@84fc8d" in it. After looking into the documentation understood that this method is a little like System.out.print() and just return a PrintStream to display (in console for example), so I tried converting it with .toString or String.valueOf() but I