You need to do something like this for your case:-
int i = 0;
while((str = in.readLine()) != null){
arr[i] = str;
i++;
}
But note that the arr
should be declared properly, according to the number of entries in your file.
Suggestion:- Use a List
instead(Look at @Kevin Bowersox post for that)