Programming Reference/Librarys
Question & Answer
Q&A is closed
This is an old revision of the document!
format args to the format string format and write the result to the stream
format(String format, Object... args); return value: stream
String strout = null; String str = "is the answer"; int i = 42; String[] args = { "way", "example" }; strout = String.format("%d %s", i, str); System.out.println(strout); strout = String.format( "this is another %s for this %s.", args ); System.out.println(strout);
42 is the answer this is another way for this example.