cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: svn commit: r588283 [14/18] - in /incubator/cxf/branches/jliu: ./ api/ api/src/main/java/org/apache/cxf/databinding/ api/src/main/java/org/apache/cxf/io/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ api/src/main/jav...
Date Mon, 29 Oct 2007 15:52:15 GMT


Glen,

On Friday 26 October 2007, Glen Mazza wrote:
> Am Donnerstag, den 25.10.2007, 17:10 +0000 schrieb jliu@apache.org:
> > Modified:
> > +    public final void setAsync(final boolean newAsync) {
> > +        this.async = newAsync;
> >      }
>
> Hmmm.  Pardon the Java 101 question, but what does the "final"
> qualifier on the newAsync argument signify?
>
> Thanks,
> Glen

For primitives like booleans, it basically means the variable is "const" 
and cannot be changed.    For non-primitives, it means the variable 
cannot be assigned a new value, but the object it does point to can be 
modified (getters/setters/etc...).     The main use for having a final 
parameter is if your method then creates an anonymous inner class or 
similar that needs access to it.   In that case, it would need to be 
final or the compiler will complain.


-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Mime
View raw message