I'm having trouble understanding a certain
Java problem.
Below is the class for the problem
Question
1. What will be printed out when the following code is run?
Fraction a = new Fraction(2,3);
Fraction b = new Fraction();
b.invert();
b.addToFraction(new Fraction(3,4));
a.addToFraction(b);
a.print();
(1) 7/6
(2) 17/12
(3) 5/7
(4) 6/7
(5) 2/1
we are also supposed to trace the program. I get stuck on b.addToFraction(new Fraction(3,4));, what is happening there? If somebody could explain the whole program for me that would be great.
Thanks