Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Doing one last thing to a WeakReference

Reply
Thread Tools

Doing one last thing to a WeakReference

 
 
Paul J. Lucas
Guest
Posts: n/a
 
      07-02-2008
Arne Vajhøj wrote:
> Stefan Ram wrote:
>> In [1], it is described how to write a class
>> »FileInputStreamOpenCloseAndNull« so that
>>
>> for( final java.io.FileInputStream fileInputStream:
>> new FileInputStreamOpenCloseAndNull( "input.txt" ))
>> use( fileInputStream );
>>
>> will close »fileInputStream« after the use.

>
> The same can be achieved with a finally.


Except if "after the use" is not lexically scoped.

- Paul
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Movie/DVD Review - One Last Thing... John Metzger DVD Video 0 06-13-2006 08:04 PM
One last thing about SocketServer rbt Python 1 10-10-2005 01:42 PM
one thing solved, but other terrible thing occur... Zam ASP General 1 03-14-2005 06:09 PM
How to use WeakReference in a HashMap? Xavier Tarrago Java 5 06-19-2004 05:08 PM
Detecting when a WeakReference gets cleared. Dave Rudolf Java 2 10-21-2003 12:59 AM



Advertisments