java: about read txt file into array
<p>i want read txt file into array.<br>
In the array, how can i do that? data = new String[lines.size]
<br>i dont want to hard code 10 in the array.
<br>My code:</p>

<pre><code>    BufferedReader abc = new BufferedReader(new FileReader(myfile));
    String []data;
    data = new String[10]; // &lt;= how can i do that? data = new String[lines.size]

    for (int i=0; i&lt;lines.size(); i++) {
        data[i] = abc.readLine();
        System.out.println(data[i]);
    }
    abc.close();
</code></pre>
