⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 randomwritetest.java

📁 Java程序设计技巧与开发实例附书源代码。
💻 JAVA
字号:

import java.io.*;

public class RandomWriteTest
{
  public static void main(String args[])
  {
    try
    {
      FileOutputStream fs_out = new FileOutputStream("sample.dat");
      DataOutputStream out = new DataOutputStream(fs_out);
      for (int i = 0; i < (int) (Math.random() * 10000) + 10000; i++)
      {
        out.writeDouble(Math.random());
      }
      out.close();
    }
    catch (FileNotFoundException fe)
    {
      System.err.println(fe);
    }
    catch (IOException ioe)
    {
      System.out.println(ioe);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -