Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Beginning Java and the fly likes String Array without knowing dimensions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String Array without knowing dimensions" Watch "String Array without knowing dimensions" New topic

String Array without knowing dimensions

Anjanesh Lekshminarayanan
Ranch Hand

Joined: Oct 21, 2003
Posts: 46
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.

Anjanesh Lekshminarayanan
Yosi Hendarsjah
Ranch Hand

Joined: Oct 02, 2003
Posts: 164
Hi Anjanesh,
You can use classes that implement List interface, like ArrayList or Vector.

I agree. Here's the link:
subject: String Array without knowing dimensions
Similar Threads
Dynamically Creating Files......
Ignoring white space
AJAX with php
How to get a transfer function to work both ways?
how to convert .csv files into sql server files using java