How to Create Text File using Java Program

Create Text File using Java

In this example, I am attaching Simple program about, How to Create Text File using Java. The example program has been tested and shared in the post.

CreateTxtFile.java

Output

Enter the file name ?
dineshkrishnan
The file is created successfully…

Generated File

Create Text File using Java

References

1. java.io API JavaDocs
2. java.io.File API JavaDocs