File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Create .txt file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Create .txt file" Watch "Create .txt file" New topic

Create .txt file

Nick George
Ranch Hand

Joined: Nov 17, 2003
Posts: 38
Right, so i can both read and write to text pre-existing text files, and i was wondering if it is possible to create new text files.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Of course, if u create a new File object, then if ur specified file is not in the directory, then it is created as u specify in the parameter of the constructor...
It's very simple to create a new file in Java...

Co-author of SCMAD Exam Guide, Author of JMADPlus
Manoj Zachariah
Ranch Hand

Joined: Dec 08, 2003
Posts: 65
this program readers a file and writes it into another file. i hope this answers you question!
I agree. Here's the link:
subject: Create .txt file
It's not a secret anymore!