title: Is it a good idea to have a constructor validate and properly change input?
body: <p>I have been searching for an answer for this question but seems like there is mixed opinions hence its a design matter.</p>
  
  <p>Anyway, I am creating a simple Money Class that has two private instance variables.</p>
  
  <pre><code>private int dollars, cents;
  </code></pre>
  
  <p>Now, since it doesn't make sense to have lets say 0 dollars and 500 cents because then you would have 5 dollars and 0 cents, is it a good idea to make sure that dollars and cents are represented properly in the constructor and change them if they werent?</p>
  
  <p>I was thinking to validate input in my setters methods and call them from the constructor but after reading this <a href="https://stackoverflow.com/questions/4893558/calling-setters-from-a-constructor">calling setters from a constructor</a> I doubt that its the best thing to do.</p>