Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
October 11, 2004 Java gets Formatter class | ||||
---|---|---|---|---|
| ||||
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 Re: Java gets Formatter class | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | 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 Re: Java gets Formatter class | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | 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 Re: Java gets Formatter class | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | 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 Re: Java gets Formatter class | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | 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 |
Copyright © 1999-2021 by the D Language Foundation