Advertisement
drSdGdBy

read from file

Dec 25th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. List<String> lines = Files.readAllLines(Paths.get(FILE_NAME), StandardCharsets.UTF_8);
  2.             for(String line: lines){
  3.                 System.out.println(line);
  4.             }
  5.  
  6. or
  7.  
  8. Files.lines(Paths.get(FILE_NAME), StandardCharsets.UTF_8).forEach(System.out::println);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement