java finalization doubts
<p>I have some questions regarding java finalization.
For example I have one class FileHelper and this class is associated with reading file,writing file,etc.
Now my question is, I have one method writeFile() in FileHelper class.Now If I want to close that file
should I override the finalize() method and close the file or can I close the file inside the writeFile() method itself? Which is the right way to do? I have declared my File variable as a member variable. If overriding is a bad idea, then why do we want to override finalize() method? which scenario? I have read many articles,where they are saying to close system resources such as file,font etc..</p>
