From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11232c,606685f2786a81e9,start X-Google-Attributes: gid11232c,public X-Google-Thread: 103376,8f2146b9c1ab93cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-14 20:58:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.mailgate.org!mygate.mailgate.org!129.8.168.41!not-for-mail From: "Kent Paul Dolan" Newsgroups: comp.lang.ada,misc.misc Subject: Upping the ante (was): ToString? Date: Fri, 15 Mar 2002 04:58:41 +0000 (UTC) Organization: Mailgate.ORG Server - http://www.Mailgate.ORG Message-ID: References: NNTP-Posting-Host: 129.8.168.41 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.mailgate.org 1016155892 10652 129.8.168.41 (Fri Mar 15 05:58:40 2002) X-Complaints-To: abuse@mailgate.org NNTP-Posting-Date: Fri, 15 Mar 2002 04:58:41 +0000 (UTC) Injector-Info: news.mailgate.org; posting-host=129.8.168.41; posting-account=48257; posting-date=1016155892 User-Agent: Mailgate Web Server X-URL: http://mygate.mailgate.org/mynews/comp/comp.lang.ada/d58d629758a615d5bac360da8668b133.48257%40mygate.mailgate.org Xref: archiver1.google.com comp.lang.ada:21255 misc.misc:5728 Date: 2002-03-15T04:58:41+00:00 List-Id: "Nazgul" wrote in message news:a6kv3e$faat1$1@ID-107015.news.dfncis.de... > Is there something like Integer'ToString(xxx) that converts an integer to a > string ? More important, is there something like toString(), with the implied contract that _every_ object will support a parameterless call to it and do something sensible to return a string representation of the object usable for debugging, logging, or "not too fancy" data presentation? To a newbie(*) Java programmer (me) this is one of the more delightful discoveries about the language. xanthian. As an old timer computer language junkie, it is one of the more delightful discoveries about _any_ language that it supports features that are usable anywhere and always do what you want without you having to think very hard about them. "Good programmers are lazy programmers" does not usefully imply that "lazy programmers are good programmers" but the trend is sure in that direction. *[See http://www.well.com/user/xanthian/java/TravellerDoc.html for "pretty much everything I know about Java so far. plus a lot I swiped without understanding it very well", in source code form. You might find something worth stealing.] And actually, it is harder to spell what was requested in Java, something like String result = ( new Integer( someIntValue ) ).toString(); since "Integer"s are first class objects, but "int"s, the usual counting numbers, are not, one of Java's multitude of maddening flaws. [Don't get me started.] -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG