6.12上机作业
作者:互联网
package work;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class OutputData {
public OutputData(String str)
{
File f = new File("data.txt");
try {
BufferedWriter bw = new BufferedWriter(new FileWriter(f));
bw.write(str);
bw.close();
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
public static void main(String[] args) {
String str = "12345abcdef@#%&*软件工程";
new OutputData(str);
}
}
标签:java,str,上机,6.12,作业,io,import,new,String 来源: https://www.cnblogs.com/nicejun/p/11010147.html