This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Should I must program for closing data file? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Should I must program for closing data file?" Watch "Should I must program for closing data file?" New topic
Author

Should I must program for closing data file?

long lingyu
Ranch Hand

Joined: Feb 15, 2004
Posts: 51
MustI program for closing data file? I don't code for closing file.
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
I think it is probably better if you do.
All I did was to close my raf on my data class' finalize() method. But that wasn't the best way to do it, as it was probably never called by the GC. Never the less, I didn't lose any marks for that.
But close it upon your server's or standalone modes' exit. I think that is best.


Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Should I must program for closing data file?
 
Similar Threads
Writing from variables into a file
free a csv file without closing the java program?
When to close the RandomAccessFile?!!
PrintWriter can only write 130k?
on FILE attributes (badly need help)