This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Bob Simons wrote:
I looked in the source code for the java.io.FileInputStream (as an example) to see if Java's file classes use the finalize() method. They do./*** Ensures that the <code>close</code> method of this file input stream is* called when there are no more references to it. * * @exception IOException if an I/O error occurs. * @see java.io.FileInputStream#close() */ protected void finalize() throws IOException { if (fd != null) { if (fd != fd.in) { close(); } } }So I don't yet know what Josh Bloch's book says specifically, but Sun uses the finalize method in the actual Java code.Sincerely, Bob Simons Satellite Data Product Manager Environmental Research Division NOAA Southwest Fisheries Science Center 1352 Lighthouse Ave Pacific Grove, CA 93950-2079 (831)648-0272 address@hidden <>< <>< <>< <>< <>< <>< <>< <>< <><