What should be done to avoid resource leaks when writing to a file?
Call flush() only
Use BufferedReader
Use FileWriter without closing
Use try-with-resources
This question is part of this quiz :