Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 12.
- input: 6.7 This file has
- input: several input lines.
- input:
- input: 10 20 30 40
- input:
- input: test
- 6 total
- 14a.
- 0 total
- 14b.
- input: 6.7
- 1 total
- 16.
- import java.io.*;
- import java.util.*;
- public class printEntireFile
- {
- public static void main(String [] args)
- throws FileNotFoundException
- {
- Scanner pikachu = new Scanner(System.in);
- System.out.print("Input your file name");
- String file = pikachu.next();
- Scanner input = new Scanner(new File("file");
- while(input.hasNextLine())
- {
- System.out.println(input.nextLine());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement