title: how to set compile time validation on class instance members
body: <p>I have created a class like below:</p>
  
  <pre><code>class myclass
  {
    Public  int myint;
  }
  </code></pre>
  
  <p>Now I want to restrict the range of myint(min 5 and max 10).</p>
  
  <p>I want if any one set the value of  myint which is not in the range it will give a compile time error(not runtime error)
  please help me how to achive it.</p>