title: How do I write a recursive method that takes as an input an ArrayList of Integers and returns the smallest integer?
body: <p>This is regularly how it's done but it has to be recursively with no for, do-while, and while loops. if statements only.</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Scanner;
  
  public class arrayex1 {
  
      public static void main(String[] args) {
  
          Scanner input = new Scanner(System.in);
          ArrayList&lt;Integer&gt; numbers = new ArrayList&lt;Integer&gt;();
  
          System.out.println("Enter numbers: ");
  
          for (int i = 0; i &lt; 10; i++) {
              int num = input.nextInt();
              numbers.add(num);
          }
  
          for (int i = 0; i &lt; numbers.size(); i++) {
              if (numbers.get(findMin(numbers)) == i) { // If the 'smallest' index value is equal to i.
                  System.out.println(numbers.get(i) + " &lt;== Smallest number");
              } else {
                  System.out.println(numbers.get(i));
              }
          }
      }
  
      public static int findMin(ArrayList&lt;Integer&gt; n) {
  
          int min = 0; // Get value at index position 0 as the current smallest.
  
          for (int i = 0; i &lt; n.size(); i++) {
              if (n.get(i) &lt; min) {
                  min = i;
              }
          } 
  
          return min;
      }
  }
  </code></pre>