title: while loop with exception handling
body: <p>This is my first time using exception handling so be gentle. I have a simple blob class that accepts an ID, the id must be between 30 and 50 or else an exception is thrown.  </p>
  
  <pre><code>public class Blob {
  int id;
  
  public Blob() {
  
  }
  
  public Blob(int id) throws Exception {
      this.id = id;
      if (id &lt; 30 || id &gt; 50)
          throw new Exception ("id = " +id+ ", must be between 30 and 50 inclusive");
  }
  }
  </code></pre>
  
  <p>It should prompt the user to enter an id, and throw the exception if it's not between 30 and 50, and should continue until the user enters a valid input and then simply displays the id number.</p>
  
  <pre><code>public class BlobCreator {
  
  public static void main(String[] args) {
      int id;
      Scanner scan = new Scanner(System.in);
      System.out.println("Enter ID number: ");
      id = scan.nextInt();
  
      do {
          try {
              Blob b = new Blob(id);
          }
  
          catch (Exception e) {
              System.out.println(e);
          }
          System.out.println("Enter a different ID: ");
          id = scan.nextInt();
      }
      while(true);
      }   
  System.out.println("Blob ID: " +id);
  }
  </code></pre>
  
  <p>I think that I am using the throw and catch correctly, but my loop isn't working correctly so I think that should be a simple fix but I can't get it just right. Also is using a while loop like I have the best way for this situation or is there a better way to loop through throw and catch?</p>
  
  <p>Thanks for any and all help</p>