It's my understanding that, for certain object types, the compiler can use "final" 
designation as a flag for further optimizations and so it actually might be a wise 
idea to do.  If nothing else, I remember reading an interview with James Gosling on 
"object mutability", a compiler optimization whereby a final object can be decomposed 
into certain constituents (since it will never be altered).

Personally, I just don't use final designations in the way it's shown because it 
doesn't occur to me that it's important. ;)

-----Original Message-----
From: Bertrand Delacretaz [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 21, 2002 11:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Style guide (2nd update)


On Thursday 21 November 2002 17:31, Oleg Tkachenko wrote:
>. . .
>       final String myString = (String)myListIterator.next();
>. . .
> How do you think, is this final specifier only a style oriented or it have
> some performance benefit also?

I don't know about performance, but I use it all the time anyway as it makes 
intentions clearer and can save the day by preventing someone from messing up 
with the variable value.

-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to