Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

from file to array java

BufferedReader bufferedReader = new BufferedReader(new FileReader(myfile));
String []data;
data = new String[10]; // <= how can I do that? data = new String[lines.size]

for (int i=0; i<lines.size(); i++) {
    data[i] = abc.readLine();
    System.out.println(data[i]);
}
abc.close();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #file #array #java
ADD COMMENT
Topic
Name
4+1 =