Close will automatically flush your stream, so yoou dont have to flush the stream while closing. Flush is useful when you are in the middle of writing to a stream and want to push the intermediate values to the file/output stream, so that if the program crashes the data wont be lost.
From Java 7 and higher you can make use of try-with-resources to avoid writing the clean up code for cleaning up the streams.
The try-with-resources statement is a try statement that declares one or more resources. A resource is an object that must be closed after the program is finished with it. The try-with-resources statement ensures that each resource is closed at the end of the statement.