如何显示文本文件中的随机行
How to display random line from text file
for(int i=0;i<FullLineQues.length;i++){
random.nextInt(i);
Question=new String[6];
Question=FullLineQues[i].split(",");
commit=0;
made=false;
br=new BufferedReader(ir);
}
我想从文本文件中随机生成我的行,但它不起作用
基本思路是获取一个从0到行数的随机索引,然后用它来检索这一行。
int randomLineNumber = random.nextInt(numberOfLines);
for(int i=0;i<FullLineQues.length;i++){
random.nextInt(i);
Question=new String[6];
Question=FullLineQues[i].split(",");
commit=0;
made=false;
br=new BufferedReader(ir);
}
我想从文本文件中随机生成我的行,但它不起作用
基本思路是获取一个从0到行数的随机索引,然后用它来检索这一行。
int randomLineNumber = random.nextInt(numberOfLines);