Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 04 Apr 2013 04:35:04 -0500 Date: Thu, 04 Apr 2013 10:35:02 +0100 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Usefulness of "final" (Was: Re: Inserting In a List) References: <19un43xj77bua.vw45l4e2wshi.dlg@40tude.net> <%Ya7t.205181$Nl5.140602@newsfe07.iad> In-Reply-To: <%Ya7t.205181$Nl5.140602@newsfe07.iad> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4_ydnVbj7JDV1MDMnZ2dnUVZ8h6dnZ2d@bt.com> Lines: 38 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-FpbLsR5RDqR/8Sz4XOeI7JR0NomQutsUmI6okFxTIIocndqhIGiEAz6oMyMj1qWl1npLYhkXMXwWU8R!CAsdK9X/aMD/MNu4kGdFcoNsN8wqBXTJNzCdKfNZVyDaSgabzL8A2pT/RWbhzt4zozhq1mcPXw8= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2959 Xref: csiph.com comp.lang.java.programmer:23288 On 04/04/13 09:37, Arved Sandstrom wrote: > On 04/04/2013 05:09 AM, lipska the kat wrote: >> On 03/04/13 20:01, Joerg Meier wrote: >>> On Wed, 03 Apr 2013 19:51:05 +0100, lipska the kat wrote: > [ SNIP ] > >> >>> What you are thinking of is immutability, something that is not >>> formalized in Java. In Java, having final mutable fields is perfectly >>> legitimate. >> >> Can you give an example? > > This is more a matter of incorrect English. An *object* is mutable or > immutable, not a field. For variables or fields I'd never use the terms > mutable/immutable; I'd prefer simply "final" or "not final" or something > similar. > > What Joerg meant is that if the final field is of a reference type then > it is perfectly possible that the object assigned to it is mutable. Something which I have never argued against. There are no two ways about it, a final variable is not modifiable once assigned to, the fact that the variable is a reference to a possibly modifiable instance of something or other is irrelevant to my original assertion. A variable that is final is no longer variable, it is not modifiable, on that I think we all agree. Another enjoyable discussion. lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun