Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #35908
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | Arne Vajhøj <arne@vajhoej.dk> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: "Double.toString" |
| Date | Sun, 20 Nov 2016 09:08:04 -0500 |
| Organization | Aioe.org NNTP Server |
| Lines | 31 |
| Message-ID | <o0sao3$1siv$1@gioia.aioe.org> (permalink) |
| References | <Double-toString-20161119164723@ram.dialup.fu-berlin.de> <o0qabv$19gb$1@gioia.aioe.org> |
| NNTP-Posting-Host | PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | csiph.com comp.lang.java.programmer:35908 |
Show key headers only | View raw
On 11/19/2016 2:49 PM, Arne Vajhøj wrote: > On 11/19/2016 10:53 AM, Stefan Ram wrote: >> When a course participant used the static method >> »Double.toString«, I said it won't work this way, >> because there is no such static method. >> >> Turned out, a static »toString« method sits there >> fat and happy on the documentation page of the class >> »java.lang.Double«. And it does not even seem to be >> new (no »since 1.8« or some such). >> >> How could I have missed this method all those years? >> Or did I know it once and my memory failed on me? >> >> Have you been aware of this static toString method? >> Is it a "well-known", prominent method to you? > > I am always expecting the wrapper classes to have: > > .toString() > .parseXxxx(s) I would add that Double.toString is sort of a quick an dirty method. For most serious usage Decimal.format is preferred due to the better control over output. Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: "Double.toString" Arne Vajhøj <arne@vajhoej.dk> - 2016-11-19 14:49 -0500 Re: "Double.toString" Arne Vajhøj <arne@vajhoej.dk> - 2016-11-20 09:08 -0500
csiph-web