113k views
1 vote
Question match each type of source to its strength. drag each tile to the correct box. tiles secondary primary pairs more objective arrowboth reveals point of view

User Flarosa
by
8.5k points

1 Answer

2 votes

Final answer:

To create a FileOutputStream and PrintWriter in Java, you need to declare and instantiate them with the appropriate constructors. Then, you can use the PrintWriter to write to a file, ensuring you close it afterward to release system resources.

Step-by-step explanation:

The question involves creating a file output stream and a print writer in Java. To declare a FileOutputStream named outStream and a PrintWriter named okraWriter, you would write the following code in Java:

FileOutputStream outStream = new FileOutputStream("output.txt");
PrintWriter okraWriter = new PrintWriter(outStream);

Then, you can write to the file using okraWriter. For example:

okraWriter.println("sue ordered okras");
okraWriter.close();

This will write the text 'sue ordered okras' to the file named 'output.txt'. Remember to close the PrintWriter after you're done to flush the buffer and release system resources.

User Ropeladder
by
7.6k points