Printing Object Information
So I created two fraction objects using:
And I initialized the Fraction result using:
Fraction f1 = new Fraction(num1, denom1);
Fraction f2 = new Fraction(num2, denom2);
My print statement is:
Fraction result = f1.plus(f2);
operation is just a char variable and not important.
System.out.println(f1.print() + " " + operation + " " + f2.print() + " = " + result.print());
And when I compile it runs into a problem at 'result.print', but if I comment that part out, f1 and f2 print just fine. Why?