Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. package main;
  2.  
  3. import java.lang.Math;
  4. import java.io.*;
  5. import java.io.BufferedReader;
  6. import java.io.FileReader;
  7. import java.io.IOException;
  8. import java.util.Scanner;
  9.  
  10. public class main {
  11. public static void main(String args[]) throws FileNotFoundException {
  12. File file = new File( "F:\\Nowy Windows\\Pulpit\\wolf.txt" );
  13. Scanner in = new Scanner( file );
  14. try (BufferedReader br = new BufferedReader(new FileReader(file))) {
  15. String line;
  16. while ((line = br.readLine()) != null) {
  17. System.out.println( line );
  18. }
  19. } catch (IOException e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement