Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.util.Scanner;
- /**
- * Created by charlie on 25/06/2016.
- */
- public class PrintFile {
- public static void main(String... args) {
- try (Scanner scanner = new Scanner(new File("/Users/charlie/sonnet116.txt"))){
- while (scanner.hasNext())
- System.out.println(scanner.nextLine());
- }catch (FileNotFoundException e){
- System.err.println("Cannot find file");
- }
- }
- }
Add Comment
Please, Sign In to add comment