Solved

Consider a Rational Class Designed to Represent Rational Numbers as a Pair

Question 2

Multiple Choice

Consider a Rational class designed to represent rational numbers as a pair of int's, along with methods reduce (to reduce the rational to simplest form) , gcd (to find the greatest common divisor of two int's) , as well as methods for addition, subtraction, multiplication, and division. Why should the reduce and gcd methods be declared to be private.


A) Because they will never be used
B) Because they will only be called from methods inside of Rational
C) Because they will only be called from the constructor of Rational
D) Because they do not use any of Rational's instance data
E) Because it is a typo and they should be declared as public

Correct Answer:

verifed

Verified

Related Questions