Thread: list
View Single Post
  #4 (permalink)  
Old 11-20-2007, 09:22 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
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:
Code:
while((line = br.readLine()) != null) { strs[count++] = line; System.out.println("count = " + count + " line = " + line); }
to see what is happening inside the while loop.
Reply With Quote