package file;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
public class TestWrite {
public static void main(String[] args) throws IOException {
// 文件写出的路径
String distFilePath = "/Users/hike/Desktop/java/JavaSE/write.txt";
Writer write = new FileWriter(distFilePath);
// 写入一个字符的编码
// write.write(97);
// write.write('b');
// char[] text = {'c', 'd'};
// write.write(text);
String text = "一只站在树上的鸟儿,\n" +
"从来不会害怕树枝断裂,\n" +
"因为它相信的不是树枝,\n" +
"而是它自己的翅膀。\n";
write.write(text);
write.close();
}
}