Unverified Commit 155d8aef authored by Lokesh Singh's avatar Lokesh Singh Committed by GitHub

Create fileWriter.java

parent d5b5ea2d
import java.io.FileWriter;
class fileWriter {
public static void main(String args[]) {
String data = "This is the data in the output file";
try {
FileWriter output = new FileWriter("output.txt");
output.write(data);
System.out.println("Data is written to the file.");
output.close();
}
catch (Exception e) {
e.getStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment