On Wed, 2002-06-26 at 23:07, Peter Donald wrote:
> At 03:59 PM 6/26/2002 +0000, you wrote:
> >In looking through Avalon source code I keep running into final in other
> >places -- method parameters:
> >
> >         public ComponentException( final String message )
> >
> >or in local variable definitions:
> >
> >     public Component lookup( final String role )
> >         throws ComponentException
> >     {
> >         final Component component = (Component)m_components.get( role );
> >
> >It's my understanding that final is to make a variable unmutable through
> >typechecking.
> 
> Sort of. It makes the reference to object immutable. (The object may still 
> be mutable). The reason for this is to avoid potential errors that can 
> occur or to eliminate bad programmings practices.

That is what I meant.

> 
> ie You should never alter a parameter reference in java and making it final 
> enforces this.
> 
> Some older JVM showed a performance increase but you should not see this 
> post 1.1 JVMs.

Thanks for the clarification.
Corey


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to