Duplicate methods in java.io.Console?
There java.io.Console
are two methods, printf
and format
, which look the same. The API says:
Calling this view method
con.printf(format, args)
behaves exactly the same as callingcon.format(format, args)
So why are there two methods? Is there a case where you prefer?
EDIT: they did it in java.io.PrintStream as well as in Java 5
source to share
Calling this form method con.printf(format, args)
behaves exactly the same as calling con.format(format, args)
- Documentation
So there is no difference, but just for syntax convenience
source to share