willieshi232

Untitled

Apr 19th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import java.util.*;
  2. import java.io.*;
  3. public class reverseLines
  4. {
  5. public static void main(String [] args)
  6. {
  7. Scanner file = new Scanner(new File("bob.txt"));
  8. reverse(file);
  9.  
  10. }
  11. public static void reverse(Scanner input)
  12. {
  13. if(input.hasNextLine())
  14. {
  15. String line = input.nextLine();
  16. reverse(input);
  17. System.out.println(line);
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment