Thread overview
Java gets Formatter class
Oct 11, 2004
Ben Hinkle
Oct 12, 2004
Walter
Oct 12, 2004
Stewart Gordon
Oct 12, 2004
Helmut Leitner
October 11, 2004
I hadn't realized this before, but Java 1.5 includes a printf formatter:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html
Finally! :-)
It's very spiffy. It includes things like argument reordering and date/time
formatting.

-Ben


October 11, 2004
Ben Hinkle wrote:
> I hadn't realized this before, but Java 1.5 includes a printf formatter:
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html
> Finally! :-)
> It's very spiffy. It includes things like argument reordering and date/time
> formatting.

%n is cool too. It outputs the platform's choice of line ending.

--anders
October 12, 2004
It's surprising how similar it is to std.format, although there are significant differences (for one, the formatter is not an object in std.format).

"Ben Hinkle" <bhinkle@mathworks.com> wrote in message news:ckes8i$253j$1@digitaldaemon.com...
> I hadn't realized this before, but Java 1.5 includes a printf formatter:
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html
> Finally! :-)
> It's very spiffy. It includes things like argument reordering and
date/time
> formatting.
>
> -Ben
>
>


October 12, 2004
Ben Hinkle wrote:
> I hadn't realized this before, but Java 1.5 includes a printf formatter:
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html
> Finally! :-)
> It's very spiffy. It includes things like argument reordering and date/time
> formatting.

I see, Java's new way of doing varargs is neat.  And I'm a bit surprised (considering awkward syntactic salt I've seen in Java before) that it's decided to invent implicit conversions between primitive types and their standard wrapper classes.

Stewart.
October 12, 2004

Stewart Gordon wrote:
> 
> Ben Hinkle wrote:
> > I hadn't realized this before, but Java 1.5 includes a printf formatter:
> > http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html
> > Finally! :-)
> > It's very spiffy. It includes things like argument reordering and date/time
> > formatting.
> 
> I see, Java's new way of doing varargs is neat.  And I'm a bit surprised

  Why are you surprised?

> (considering awkward syntactic salt I've seen in Java before) that it's decided to invent implicit conversions between primitive types and their standard wrapper classes.

  The immediate competitor C# does it. That's motivation enough.

> Stewart.

-- 
Helmut Leitner    leitner@hls.via.at
Graz, Austria   www.hls-software.com