Question: IN JAVA------------------------------------------------------------------------------------------------------------------------------------------------------- Consider the class Rational2310 below that represents a rational number using its numerator and denominator. public class Rational2310 { private int numerator; private
IN JAVA-------------------------------------------------------------------------------------------------------------------------------------------------------
Consider the class Rational2310 below that represents a rational number using its numerator and denominator.
public class Rational2310 {
private int numerator;
private int denominator;
public Rational2310(int numerator, int denominator){
this.numerator = numerator;
this.denominator = denominator;
}
public int getNumerator() { return numerator; }
public void setNumerator(int numerator) { this.numerator = numerator; }
public int getDenominator() { return denominator; }
public void setDenominator(int denominator) { this.denominator = denominator; }
/* add your method reverse here. */
/* add your method multiply here. */
}
In Rational2310, implement static methods that are called reverse and multiply to
(1) reverses a rational number and return the result as a new rational number and
(2) to multiply two rational numbers and return the result as a new rational number.
NO NEED OF MAIN OR TEST METHODS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
