1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Snowcat [4.5K]
4 years ago
9

Which statement is used to create a file object that will append data to an existing file? BufferedWriter salesdata =

Computers and Technology
2 answers:
Temka [501]4 years ago
8 0

Answer:

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

Explanation:

  • The statement BufferedWriter salesdata = new BufferedWriter(new FileWriter("out.dat", true); can be used to create a file object that will append data to an existing file.
  • Here, BufferedWriter class is used to create text from an output stream.
  • Here, FileWriter is used to create the file from the text. The constructor for FileWriter is FileWriter (String filename, boolean append).
  • Here, filename is string ("out.dat") is provided and the append is boolean can be either true (if the text has to be appended at the end of the file) or false (if the text hasn't to be appended at the end of the file).
  • So, option (b) is correct.
  • Option (a) is not correct as it indicates the text shouldn't be appended at the end of the file as the boolean is false.
  • Option (c) is not correct as it doesn't mean to append as there is no boolean true indicated in the constructor.
  • Option (d) is not correct as there is not such kind of syntax.

Charra [1.4K]4 years ago
7 0

Answer:

Answer:

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

Explanation:

The statement BufferedWriter salesdata = new BufferedWriter(new FileWriter("out.dat", true); can be used to create a file object that will append data to an existing file.

Here, BufferedWriter class is used to create text from an output stream.

Here, FileWriter is used to create the file from the text. The constructor for FileWriter is FileWriter (String filename, boolean append).

Here, filename is string ("out.dat") is provided and the append is boolean can be either true (if the text has to be appended at the end of the file) or false (if the text hasn't to be appended at the end of the file).

So, option (b) is correct.

Option (a) is not correct as it indicates the text shouldn't be appended at the end of the file as the boolean is false.

Option (c) is not correct as it doesn't mean to append as there is no boolean true indicated in the constructor.

Option (d) is not correct as there is not such kind of syntax.

Click to let others know, how helpful is it

The

You might be interested in
Java’s class Color has a constructor that takes three integers as parameters: the red, green, and blue components of the color
Tanzania [10]

Answer:

    public Balloon(){

          //Invokes the 2 argument constructor for balloon with relevant  

          //parameters

          this(10,new Color(135,206,250));

    }

Explanation:

class Balloon{

    //Private fields in the Balloon class

    private double radius = 0;

    private Color c = null;

    // Constructor with two arguments - radius and Color

    public Balloon(double radius,Color c){

         this.radius = radius;

         this.c = c;

    }

    // No argument constructor

    public Balloon(){

          //Invokes the 2 argument constructor for balloon with relevant  

          //parameters

          this(10,new Color(135,206,250));

    }

}

3 0
4 years ago
Which of the following is NOT considered a step in the problem solving process. A Try B Discover C Prepare D Define
pashok25 [27]

Answer:

c

Explanation:

4 0
3 years ago
Pls help mark brainliest
kozerog [31]

Answer:

I cant answer this.

Explanation:

You need to take another screenshot so we can see the multiple choice.

4 0
3 years ago
What dose the window desktop display
saveliy_v [14]
Icons and its UI. Login screen
5 0
3 years ago
What is the equivalent of film speed in digital cameras?
elena55 [62]
The equivalent of film speed in a digital camera is going to be sensitivity. This will make the correct answer B. 
3 0
4 years ago
Read 2 more answers
Other questions:
  • Which of the following statements is not true about the TCP opening and closing of connections?
    6·1 answer
  • What should a consultant recommend to meet this requirement?Universal containers assign its contact center agents to certain int
    12·1 answer
  • Match the expenses to their respective categories.
    6·2 answers
  • You found an image on the Creative Commons that you would like to use. How do you give credit to the author? *
    7·2 answers
  • FIFTY POINTS IF YOU CAN HELP ME!!!!
    11·1 answer
  • The red dot says ‘you tried to read records from a table called “Netflix Content” but that table doesn’t exist in this’
    7·1 answer
  • Output is the act of is the act of entering the data to the computer?​
    10·1 answer
  • A construction-based client would like to develop an application that can analyze an image of machinery and overlay information
    8·1 answer
  • Match the components of a blog to their descriptions.
    11·1 answer
  • Giving away free brainliest
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!