The description of JSR 51 (http://jcp.org/en/jsr/detail?id=51) indicates that a simple printf-style formatting facility was proposed for inclusion in NIO. If you’re familiar with the C language, you’ve probably worked with the printf() family of functions that support formatted output.
One feature that makes the printf() functions useful is varargs, which lets you pass a variable number of arguments to these functions. Because support for varargs wasn’t added to Java until JDK 5, and because this support is very useful for achieving formatted output, the printf-style formatting facility was deferred to JDK 5.
This chapter explores JDK 5’s printf-style formatting facility.
JDK 5 introduced the java.util.Formatter ...