title: Calling method within itself
body: <p>I wanted to make an input which accepts numbers from 1 - 10 and prints the range. </p>
  
  <p>I need to check if the input is an integer (check), check if the range is 0-10 (check), and if it's not any of those things, to ask the user again. So, a recursive method? </p>
  
  <p>Currently I have this:</p>
  
  <pre><code>import java.util.Scanner; 
  import java.util.InputMismatchException; 
  
  public class FinalTest {
    public static void main (String [] args) {
  
      Scanner in = new Scanner(System.in);
      int k = 0;
  
      System.out.print("int - ");
  
      try {
        k = in.nextInt();
      } catch (InputMismatchException e) {
        System.out.println("ERR: Input");
        System.exit(1);
      }
  
      if(k &lt;= 10 &amp;&amp; k &gt; 0) {
        for(int j=1; j &lt;= k; j++) {
          System.out.println(j);
        }
      } else {
        System.out.println("ERR: Oob");
        System.exit(1);
      }
    }
  }
  </code></pre>
  
  <p>I would like to replace the "System.exit()" so that it re attempts to ask the user for input again. </p>
  
  <p>calling <code>main();</code> produces an error. </p>
  
  <p>How do I correctly call the main method in this case?</p>