Printf has been added since Java 1.5. But I don't know how to print it out as a string instead of a file like sprintf does in c Please tell me how to do it.
string java formatting
//Save in the result in a formalized form.
String result = String.format("%4d", i * j);
// Output to standard output.
System.out.println( result );
© 2024 OneMinuteCode. All rights reserved.