Assignment to this.
Tom Kaitchuck <[email protected]> Thu, 07 Jul 2005 11:10:43 -0700
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
One thing I have always wished Java would support is assignment to the
"this" variable. It is understandable that this could be hard to
implement. However it could be useful:
class foo{}
new foo(Bar b)
{
if( isEvil( b ) )
{
this = null;
return;
}
}
In this case the ability to explicitly return an object from a
constructor would serve much the same function, however it would have
the disadvantage that it could not be used in an arbitrary method.
Though might cause less confusion for multithreaded apps.
Thoughts?
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click