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