1.
Implement the simple methods
getNumerator
and getDenominator
that will return the numerator and denominator of a fraction.getNumerator
and getDenominator
that will return the numerator and denominator of a fraction.Fraction
class so that gcd
is used to reduce fractions immediately. Notice that this means the add
function no longer needs to reduce. Make the necessary modifications.compareTo
method.