class Demo
{
public static void main(String[] args)
{
FileWriter fw = null;
try
{
fw = new FileWrier("z:\\demo.txt");
catch(IOException e)
{
System.out.println(e.toString());
}
finally
{
if(fw!=null)
try
{
fw.close();
}
catch(IOException e)
{
System.out.println("close:"+e.toString());
}
}
}
}
{
public static void main(String[] args)
{
FileWriter fw = null;
try
{
fw = new FileWrier("z:\\demo.txt");
fw.write("abc“);
fw.flush();
fw.write("kkkk");
}catch(IOException e)
{
System.out.println(e.toString());
}
finally
{
if(fw!=null)
try
{
fw.close();
}
catch(IOException e)
{
System.out.println("close:"+e.toString());
}
}
}
}