It is: for(int i = 0;i<10;i++)
And the correct way would be: for(int i = 0;i<in.length;i++)
Also the OP, better add some checks whether the file has at least 10 lines:
for(int i = 0;i<in.length;i++) {
String line = in.readLine();
if (line==null) { // no more lines to read;
break;
}
id[i]=in.readLine();
result[i]=id[i];
}