Path: csiph.com!news.bbs.geek.nz!.POSTED.agency.bbs.geek.nz!not-for-mail From: Kiwi User (Kiwi User) Newsgroups: comp.lang.java.programmer Subject: Re: Please help Date: Thu, 07 Dec 2017 21:48:16 +1200 Organization: fsxNet Usenet Gateway | bbs.geek.nz/#fsxNet Message-ID: <2134599174@f38.n261.z1.binkp.net> References: <1905396492@f38.n261.z1.binkp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: news.bbs.geek.nz; posting-host="M6YmRdZYyc42DJk0lNlt/X4dpP4dzvceBNabSmESN3E"; logging-data="25937"; mail-complaints-to="abuse@news.bbs.geek.nz" User-Agent: VSoup v1.2.9.47Beta [95/NT] X-Comment-To: Eric Douglas X-MailConverter: SoupGate-Win32 v1.05 Xref: csiph.com comp.lang.java.programmer:37770 On Thu, 07 Dec 2017 13:32:49 -0800, Eric Douglas wrote: > So it does. I was thinking that's one of the automatic conversions. > Apparently String and int are only automatically compatible if you were > to do something like this. > > this.accountNum = X00000 + ""; > Yep. I do that often enough when building diagnostic println() parameters, though almost never in assignment statements. Generally I prefer the neatness of String.format() > (though the correct answer to this homework question is still:) > this.accountNum = "X00000"; > Yes, total agreement here. Beginners learning to rely on automatic conversion is likely to bite them sooner rather than later. -- Martin | martin at Gregorie | gregorie | dot org