📄 randomwritetest.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 + -