Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

read a file in java and store as integer array using buffered reader

String[] integersInString = br.readLine().split(" ");
int a[] = new int[integersInString.length];
for (int i = 0; i < integersInString.length; i++) {
    a[i] = Integer.parseInt(integersInString[i]);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #file #java #store #integer #array #buffered #reader
ADD COMMENT
Topic
Name
3+3 =