Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #37770
| From | Kiwi User <martin@mydomain.invalid> (Kiwi User) |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Please help |
| Date | 2017-12-07 21:48 +1200 |
| Organization | fsxNet Usenet Gateway | bbs.geek.nz/#fsxNet |
| Message-ID | <2134599174@f38.n261.z1.binkp.net> (permalink) |
| References | <1905396492@f38.n261.z1.binkp.net> |
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
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Please help rustboy86@gmail.com (rustboy86) - 2017-12-07 06:02 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 07:10 +1200
Re: Please help rustboy86@gmail.com (rustboy86) - 2017-12-07 07:33 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 08:22 +1200
Re: Please help rustboy86@gmail.com (rustboy86) - 2017-12-07 08:31 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 08:54 +1200
Re: Please help rustboy86@gmail.com (rustboy86) - 2017-12-07 09:29 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 10:11 +1200
Re: Please help Kiwi User <martin@mydomain.invalid> (Kiwi User) - 2017-12-07 18:04 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 10:14 +1200
Re: Please help rustboy86@gmail.com (rustboy86) - 2017-12-07 10:36 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 10:44 +1200
Re: Please help rustboy86@gmail.com (rustboy86) - 2017-12-07 11:04 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 13:35 +1200
Re: Please help Kiwi User <martin@mydomain.invalid> (Kiwi User) - 2017-12-07 21:22 +1200
Re: Please help Eric Douglas <e.d.programmer@gmail.com> (Eric Douglas) - 2017-12-07 13:32 +1200
Re: Please help Kiwi User <martin@mydomain.invalid> (Kiwi User) - 2017-12-07 21:48 +1200
csiph-web