我看到一些程序上说,把数据存入外存,究竟怎样实现的?

解决方案 »

  1.   

    //随便写个文件存了就是了//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^
      

  2.   

    不是内存就算外存,那么范围就比较广。简单直接写个file,或者入库都算是
      

  3.   

    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();
    }
    }
    看看有用不?
      

  4.   

    内存就是我们说的ram, 虚拟内存就是用一个外存(硬盘空间)保存内存的分页信息.
    外存就是除去内存的全部存储介质: 硬盘,磁带,光盘,软盘......
      

  5.   

    序列化?
    implement java.io.Serializable
      

  6.   

    import java.io.Serializable