FileWriter output

Report a typo

Suppose that we have a file file.txt that contains one line:

before latin

How does the following piece of code change the file's content?

File file = new File("file.txt");

try (FileWriter fileWriter = new FileWriter(file)) {
    fileWriter.write("Lorem ipsum");
    fileWriter.write(" dolor sit amet");
}

Select the correct option with file's content after the method completion:

Select one option from the list
___

Create a free account to access the full topic