Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to read from a txt file in java

try (BufferedReader br = new BufferedReader(new FileReader("file.txt"))) {
    String line = br.readLine();
    while (line != null) {
      	System.out.println(line);
        line = br.readLine();
    }
}
 
PREVIOUS NEXT
Tagged: #read #txt #file #java
ADD COMMENT
Topic
Name
1+2 =