// another recursion example // this will print all the numbers entered by the user in REVERSE order import java.util.*; public class AskAgain { public static void main(String[] args) { Scanner in = new Scanner(System.in); ask(in); } public static void ask(Scanner s) { System.out.print("Enter an integer (0 to quit): "); int x = s.nextInt(); if (x != 0) ask(s); System.out.println("You entered: " + x); } }