Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import java.io.File;
  2. import java.io.FileNotFoundException;
  3. import java.util.*;
  4. public class MoreRecursion {
  5. public static void main(String[] args) throws FileNotFoundException {
  6. Scanner read = new Scanner(new File("src/text.txt"));
  7. reverse(read);
  8. }
  9.  
  10. public static void reverse(Scanner read){
  11. if (read.hasNextLine()) {
  12. String line = read.nextLine();
  13. reverse(read);
  14. System.out.println(line);
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement