title: How can validation users input in integers?
body: <p>I'm trying to validate choice and quantity. I only create 5 choices for the user to enter and I don't want them to enter any String/Char type or any number higher than 5. </p>
  
  <pre><code>System.out.print("Please enter the assigned number of the item sold: "); 
      choice = display.nextInt();
  switch(choice){ 
              case 1:
                  price=one; 
                  break;
              case 2:
                  price=two;
                  break; 
              case 3:
                  price=three;
                  break; 
              case 4:
                  price=four;
                  break; 
              case 5:
                  price=five;
                  break;
  
      } // end of switch case
  </code></pre>
  
  <p>For quantity, there's no limit but I don't want the user to enter String/Char type.</p>
  
  <pre><code>System.out.print("Please enter the quantity of the item sold: "); 
      quantity = display.nextInt();
  </code></pre>
  
  <p>How can it be done?</p>