TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Java File Write Program
Alagunila Meganathan
Aug 02
2016
Code
393
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
FileWrite.rar
import
java.io.*;
class
FileWrite
{
public
static
void
main(String args[])
{
try
{
// Create file
FileWriter fstream =
new
FileWriter(
"out.txt"
);
BufferedWriter out =
new
BufferedWriter(fstream);
out.write(
"Hello Java"
);
//Close the output stream
out.close();
}
catch
(Exception e){
//Catch exception if any
System.err.println(
"Error: "
+ e.getMessage());
}
}
}
JAva
File
write