Welcome to the Treehouse Community
Looking to learn something new?
Andrew D.2,937 Points
Not Necessary to Close Object Output Stream?
Hey guys.. I noticed Craig didn't end up using the oos.close() code. I come from C++ where closing an output stream is vital. Is there some new quirk in Java that doesn't make it necessary to close an object output stream?
Seth Kroger56,407 Points
Thanks to a relatively new feature introduced in Java 7 they'll be automatically closed after the try/catch block. The I/O classes have an interface called AutoCloseable. Anything opened in the parentheses after try with that interface are taken care of.