October 2017
Beginner
318 pages
7h 26m
English
Lastly, there's a lot of different writers available to us in Java, and FileWriter is just one of them. I decided to show it to you here because it's pretty simple. It takes some text and prints it to a file. Very often, however, you'll see FileWriter wrapped around by the BufferedWriter class. Now the declaration of the BufferedWriter class will look like the one given in the following code block, where BufferedWriter is created and given FileWriter as its input.
The BufferedWriter class is pretty cool because what it does is it intelligently takes all the commands you give it and attempts to write the content to a file in the most efficient way possible:
package writingtofiles; import java.io.*; public class WritingToFiles ...
Read now
Unlock full access