I watched my lecturer's video from my university and he says about the Rational class that its constructor goes like this:
Rational (int top=0 , int bottom=1)
: t(top) , b(bottom) {normalize();}
Until now everything is OK, BUT !! he also said that you can call the constructor only with 1 argument (top argument) and because that bottom initialize to value of 1 the rational for example: Rational(3)
will be 3/1.
BUT !! I wonder how can we use a constructor with 1 value only if it supports 2 arguments ONLY ?
I know that in java if we have x number of argument that the constructor receive (consider no other constructor and x>0) we must transfer them all not 1 instead of 2...
Please help me solve this conflict...
thnx...