我有下面的代碼:while循環和文件流
while (FileOne.hasNextLine()){
String check = FileOne.nextLine();
Reader r = new FileReader("something");
mass1:
try{
Scanner FileTwo = new Scanner(r);
mass1:
while (FileTwo.hasNextLine()) {
String toCheck= FileTwo.nextLine().toString();
index1 = check.indexOf(toCheck);
if(index1 != -1){
index2++;
break mass1;
}//if(index1 != -1)
}//(it.hasNext())
}//try
finally {
r.close();
}//finally
}//while (FileOne.hasNextLine())
,我想問問: 當第二,而又名而(FileTwo.hasNextLine)結束(帶或不帶break命令),下一解析器會轉到該命令的時候,文件將從上次開始還是從上次的位置開始? 如果它不從開始,那麼我將如何使它從開始(開始)?
爲什麼你有兩個'mass1'標籤? –