Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1.  
  2. import java.io.IOException;
  3. import java.nio.file.Files;
  4. import java.nio.file.Paths;
  5. import java.util.stream.Stream;
  6.  
  7. public class FileRead {
  8. public static void main(String[] args) {
  9. String name = "nilesh.list";
  10. try (Stream<String> lines = Files.lines(Paths.get(name))) {
  11. lines.forEach(System.out::println);
  12. } catch (IOException e) {
  13. e.printStackTrace();
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement