I have been searching for an answer for this question but seems like there is mixed opinions hence its a design matter.
Anyway, I am creating a simple Money Class that has two private instance variables.
private int dollars, cents;
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?
I was thinking to validate input in my setters methods and call them from the constructor but after reading this calling setters from a constructor I doubt that its the best thing to do.