写文件
视频锁定
{$ currentTime | date:'mm:ss' $}
{$ timeLeft | date:'mm:ss' $}
Java如何写文件呢?我们下面写一个简单的程序来看看,代码很简单:
/**
* 写文件简单操作
*
*/
public class FileWrite {
public static void main(String[] args) throws Exception {
FileWriter fw = new FileWriter("D://新建文件.txt");
String s = "hello fenby 欢迎大家来fenby社区交流学习";
fw.write(s,0,s.length());
fw.flush();
}
}
在线练习
{$ activeFileHint $}