生成 随机数列 到txt文件 java
@Test
public void test_case_Random() throws Exception {
Random rd1 = new Random();
String path="D://Documents and Settings//Random.txt";
for(int i=0;i<10000;i++){
try {
FileWriter fw=new FileWriter(path,true);
BufferedWriter bw=new BufferedWriter(fw);
bw.newLine();
bw.write(rd1.nextInt()+" "+rd1.nextInt());
bw.close();
fw.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}