Answers for "java code to read and write data from text file"

3

writing to a text file java

PrintWriter writer = new PrintWriter("the-file-name.txt", "UTF-8");
writer.println("The first line");
writer.println("The second line");
writer.close();
Posted by: Guest on April-07-2020
0

How do you write or read data from or to file with Java?

Read data: I can use classes bufferedReader and bufferwriter. 
Lets say I have a text in Java.
I use bufferedReader to read the files if it is a random file 
bufferedReader is only the functionality to read a file.
For, Excel files I use the special library, Apache POI library. 
These are external libraries. 
I use properties class to read the properties files. 
Scanner class also for read the data from files
Posted by: Guest on May-28-2021

Code answers related to "java code to read and write data from text file"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language