Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter the file name with extention : ");
- File file = new File(input.nextLine());
- input = new Scanner(file);
- while (input.hasNextLine()) {
- String line = input.nextLine();
- System.out.println(line);
- }
- input.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement