给定以下的Java代码存在错误,通过阅读找出共有几处错误。
import java.io.*;
public class TestIO {
public static void main(String []args){
String str ="文件写入练习"; FileWriter fw = null; //1
try{
fw = new FileWriter("c:\mytext.txt"); //2
fw.writerToEnd(str); //3
}catch(IOException e){ //4
e.printStackTrace();
}
finally{
//此处省略关闭流
}
}
}