Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

from file to array java

ArrayList<String> result = new ArrayList<>();
 
try (BufferedReader br = new BufferedReader(new FileReader(filename))) {
    while (br.ready()) {
        result.add(br.readLine());
    }
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #file #array #java
ADD COMMENT
Topic
Name
5+4 =