title: Can you go back to a specific line in your code?
body: <p>I'm trying to make an index basically and if someone messes up I want them to be able to return to the last menu or the last selection screen, or just restart. Is this possible?</p>
  
  <p>I'm using JCreator. It's my first program so I've kept it very simple; it's just a bunch of if-else statements. Looks a little something like this.</p>
  
  <p>edit: Would it be easier if I made a restart button in the program interface or whatever you would call it?</p>
  
  <pre><code>public class Index
  {
      public static void main(String[] args)
      {
          Scanner key = new Scanner(System.in);
          System.out.println("What kind of sandwich are you looking for?");
          System.out.println("1. Ham   2. Turkey   3. etc.");
          int meat = key.nextInt();
  
          if (meat == 1)
          {
              System.out.println("What type of cheese would you like"?);
              System.out.println("1. Swiss    2. Cheddar   3. etc.");
              int cheese = key.nextInt();
              if (cheese == 1)
              {
                  System.out.println("Would you like lettuce and/or tomatoes?");
                  System.out.println("1. Just lettuce   2. Just tomatoes   3. Both   4. Neither");
                  int lOrT = key.nextInt();
              }
          }
  
          if (meat == 2)
          {
              System.out.println("What type of cheese would you like"?);
              System.out.println("1. Swiss    2. Cheddar   3. etc.");
              int cheese = key.nextInt();
              if (cheese == 1)
              {
                  System.out.println("Would you like lettuce and/or tomatoes?");
                  System.out.println("1. Just lettuce   2. Just tomatoes   3. Both   4. Neither");
                  int lOrT = key.nextInt();
              }
          }
      }
  }
  </code></pre>