import java.io.*;
public class FileWriterTest
{
public static void main(String[] args)
{
FileWriterTest t = new FileWriterTest();
t.WriteMyFile();
}
void WriteMyFile()
{
try
{
FileWriter fw = new FileWriter("mydata.txt");
PrintWriter out =new PrintWriter(fw);
out.print("Hello,World!");
out.close();
fw.close();
}
catch(IOException e)
{
System.out.println("OH,got an IOException error!");
e.printStackTrace();
}
}
}
posted on 2007-05-28 00:28
jadmin 阅读(48)
评论(0) 编辑 收藏