title: haw to validate values in set methods?
body: <p>I recently began to learn object oriented programming and i have a question.
  for example i am doing a class called student and i have his ID so i am going to write a setID method</p>
  
  <pre><code>  public int setID(idval)
     {if(idval&gt;=0 &amp;&amp;idval&lt;=100) 
          ID=idval;
      else system.out.print("Invalid ID");
     }
  </code></pre>
  
  <p>My question is haw do i need to ask the user to enter another id because the first one was invalid.
  haw the user can try again another id if the first was invalid ??</p>