Java 创建文本内容
import java.io.FileWriter; import java.io.IOException; public class TestFile { public static void main(String[] args) { StringBuffer sb=new StringBuffer(); sb.append("12345/n"); sb.append("abcde/n"); sb.append("123.abc"); try { FileWriter fw=new FileWriter("c:/test.txt"); fw.write(sb.toString()); fw.close(); } catch (IOException e) { e.printStackTrace(); } } }
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/16620.html