title: How to ask te user and depending on his response run all the code again?
body: <p>I'm a newbie in Java. I started these days and I'm practicing the catch and try exception. I have this code below  which solve an operation between to numbers and I'd like to know what can I do, if for example I want that the user, once he makes an operation and get his result, that this has the possibility to make another operation. something like comes up a question asking if he wants to realize another problem and the code run again from the beginning.</p>
  
  <pre><code>package justpractice;
  import java.util.*;
  public class Main {
  
  
  public static void main(String[] args) {
      Scanner Operation = new Scanner(System.in);
  
      int x=1;
  
      while(x==1){
          try{
              System.out.println("Insert numerator");
              int n1 = Operation.nextInt();
              System.out.println("Insert denominator");
              int n2=Operation.nextInt();
              double division = n1/n2;
              System.out.println(division);
              x=2;
  
      }
  
      catch(Exception e){
              System.out.println("Insert a valid value");
      }
      }
  }
  
  
  
  }
  </code></pre>