Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Java puzzler Date: Wed, 11 May 2011 09:12:17 -0400 Organization: albasani.net Lines: 25 Message-ID: References: <4db69c13-878f-4806-adb2-a3c5adb1c48c@glegroupsg2000goo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net oenaOIXM5L1aM+AfGVe6Gp/zvpNdlPgumEAYvgOnLOL9i6PK8iFdox4CeInhQ0aysXWMsJ6BELLqlT6DpPWzwC3CpqpG+BiIn6b+JFQudOOcah9Wx3G3fvPUrhGPQ44k NNTP-Posting-Date: Wed, 11 May 2011 13:12:15 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="22T8ugmkOZW35eyMmLCwX8cAghZrvFYzpIJpeeQsvu+zRzSK4wmUgE0IivuSZsAU2NF4sqQsPwqgw2e5QPkwMxAg5Wzid+blS8B36AT15UjArQ7iQcuVNkDNtnIDkmG4"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 In-Reply-To: <4db69c13-878f-4806-adb2-a3c5adb1c48c@glegroupsg2000goo.googlegroups.com> Cancel-Lock: sha1:5kC89iUMz2R4fvq1KEoCONVFzGQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3972 On 05/11/2011 04:44 AM, Gábor Bakos wrote: > It worked as specified. I just found unexpected that there is an implicit cast to the type of the variable. > For example there are not compiling: > int x = 0.5; > int y = 0; > y = y + 0.5; > These are no strange for me. > Although the thing that > int x = 0; > x += .5; > compiles without an error or warning it was unexpected for me. I do not see the usecase for the implicit cast there. (BTW the result I got was the correct 0 .) > Maybe it is just me who finds this strange. > Thanks, gabor You should STOP fracturing newsgroup threads by using that stupid GoogleGroups "feature" that breaks conversations. There's no excuse for that. Note the "reply-to" and the artificial imposition of an email-like address in your post. Bad! Bad! You're ruining it for everyone else trying to follow the conversation. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg