The value of the
int variable "count" increases every time another line is read so its final value should be the number of non–null elements in the "strs" array.
Try this:
while((line = br.readLine()) != null) {
strs[count++] = line;
System.out.println("count = " + count + " line = " + line);
}
to see what is happening inside the
while loop.