132k views
3 votes
Which statement is used to create a file object that will append data to an existing file? BufferedWriter salesdata =

new BufferedWriter(new FileWriter("out.dat", false);.
new BufferedWriter(new FileWriter("out.dat", true);.
new BufferedWriter(new FileWriter("out.dat");.
new BufferedWriter(new FileWriter("out.dat", append);.

2 Answers

5 votes

Answer:sorry that I can’t help on this try calling 2759999

Step-by-step explanation:

User Gordon Dickens
by
7.0k points
2 votes

Answer:

new BufferedWriter(new FileWriter("out.dat", true));

Step-by-step explanation:

We can use the BufferedWriter and FileWriter classes to create a File object which will append data to an existing file. For this purpose we can use the following statement:

BufferedWriter salesdata = new BufferedWriter(new FileWriter("out.dat", true));

This opens the file "out.dat" for writing in append mode and uses this FileWriter to create an instance of BufferedObject instance.

User Barry Scott
by
5.6k points