Is there any difference between PrintWriter.format and PrintWriter.printf? The printf api says, "An invocation of this method of the form out.printf(format, args) behaves in exactly the same way as the invocation out.format(format, args)." If this is the case, what's the point of having two methods that do the same thing?
And according to the javadocs, they do the same thing. How is one more convienent than the other? I'm not seeing how either requires the creation of a Formatter. Perhaps you thought I was talking about Formatter's format method.
Well, They wanted to add System.out.printf() to Java
the "out" in the System object is a PrintWriter. That is what they wanted, now the format() method was already in Java, and instead of removing it and breaking all the code written using the format method, then kept the format method for backwards compatibility. I do know they added the varagrs to the format method, but that will not break backwards compatibility.
To me, it looks like they both have the exact same results.