//随便写个文件存了就是了//e.g.c:\\1.txt File f = new File("c:\\1.txt"); if(!f.exits)f.creatNewFile();// creat a stream BufferedOutPutStream bo = new BufferedOutPutStream(new FileOutPutStream(f));// write information, e.g.String s bo.write(s.getbytes); bo.flush;// have a try ^o^
不是内存就算外存,那么范围就比较广。简单直接写个file,或者入库都算是
public void writeFile(String content) { try { FileWriter fw = new FileWriter(file, true); PrintWriter out = new PrintWriter(fw); out.print(content + "\t"); out.close(); fw.close(); } catch (IOException e) { System.out.println("Uh oh, got an IOException error!"); e.printStackTrace(); } } 看看有用不?
File f = new File("c:\\1.txt");
if(!f.exits)f.creatNewFile();// creat a stream
BufferedOutPutStream bo = new BufferedOutPutStream(new FileOutPutStream(f));// write information, e.g.String s
bo.write(s.getbytes);
bo.flush;// have a try ^o^
{
try
{
FileWriter fw = new FileWriter(file, true);
PrintWriter out = new PrintWriter(fw);
out.print(content + "\t");
out.close();
fw.close();
}
catch (IOException e)
{
System.out.println("Uh oh, got an IOException error!");
e.printStackTrace();
}
}
看看有用不?
外存就是除去内存的全部存储介质: 硬盘,磁带,光盘,软盘......
implement java.io.Serializable