In java.io.Console, there are two methods, printf and format, which appear to be identical. In the API it says
An invocation of this method of the form
con.printf(format, args)behaves in exactly the same way as the invocation ofcon.format(format, args)
So why have two methods? Is there a case where one is preferred?
EDIT: They've done this in java.io.PrintStream as well in Java 5
This is for the programmer who come from different programming background. C/ C++ uses printf
An invocation of this method of the form con.printf(format, args) behaves in exactly the same way as the invocation of con.format(format, args) - Documentation
So there is no difference , but just for the convenience of syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With