Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String Array without knowing dimensions

 
Anjanesh Lekshminarayanan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyway to accomplish this with setting the size of the array and without the use of java.util.Arrays ?
I need the get the lines of a file in an array (of n number of lines)
Neither do I want to repeat the entire loop of reading the file to figure out the number of lines.

Actually Im used to PHP and this would normally work in PHP.
Thanks
 
Yosi Hendarsjah
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anjanesh,
You can use classes that implement List interface, like ArrayList or Vector.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic