What is the deal with the Closeable and Flushable interfaces?
Location: http://www.jguru.com/faq/view.jsp?EID=1255936 Created: Jul 31, 2005 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) The ability to close() or flush() an object (typeically a stream) has been factored out into single method interfaces, Closeable and Flushable, respectively. Given that you sometimes need to operate on different types of objects, like InputStream, OutputStream, RandomAccessFile, and Formatter, when your done working with the class, you don’t always care what it was you operated on. Thus, instead of having different “done” like methods to close or fLush the object, you can deal with just one for all types, as long as they implement Closeable or Flushable.