digitalmars.D - Java gets Formatter class
- Ben Hinkle (6/6) Oct 11 2004 I hadn't realized this before, but Java 1.5 includes a printf formatter:
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (3/8) Oct 11 2004 %n is cool too. It outputs the platform's choice of line ending.
- Walter (6/12) Oct 11 2004 It's surprising how similar it is to std.format, although there are
- Stewart Gordon (6/11) Oct 12 2004 I see, Java's new way of doing varargs is neat. And I'm a bit surprised...
- Helmut Leitner (6/19) Oct 12 2004 The immediate competitor C# does it. That's motivation enough.
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
Oct 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
Oct 11 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 anddate/timeformatting. -Ben
Oct 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.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.
Oct 12 2004
Stewart Gordon wrote:Ben Hinkle wrote:Why are you surprised?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.-- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Oct 12 2004