Q:

BufferedWriter, FileWriter, Output Stream...What's the most modern way to do these things?

I'm trying to programically create a new a file in java, and write a string array to that file. If the file already exists, I just want to append another string array (This is like a log file). Whats the most 'modern' way to do something like this? Is FileWriter and Buffered writer still the way to go? Most of the stuff I'm finding on here is from 2010..that was 5 years ago!
Edit: I actually need to take in an ArrayList but there shouldnt be a difference

A:

Using Java NIO, you can avoid dealing with streams directly and achieve your result with:
List<String> lines = //...  

Path file = Paths.get("your path...");      
Files.write(file, lines, StandardCharsets.UTF_8,
    StandardOpenOption.APPEND, StandardOpenOption.CREATE);

You can pass multiple OptionOption values to the method. Here we pass CREATE and APPEND to tell NIO to create the file if it doesn't already exist and append to the file if it already exists.

