Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- public class reverseLines
- {
- public static void main(String [] args)
- {
- Scanner file = new Scanner(new File("bob.txt"));
- reverse(file);
- }
- public static void reverse(Scanner input)
- {
- if(input.hasNextLine())
- {
- String line = input.nextLine();
- reverse(input);
- System.out.println(line);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment