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:

Verified
Correct Answer:
Verified
Q3: Write a toString method that returns the
Q7: For the questions below, use the following
Q9: The behavior of an object is defined
Q11: An example of passing message to a
Q12: A constructor may contain a return statement
Q16: Consider a sequence of method invocations as
Q19: Formal parameters are those that appear in
Q25: Accessors and mutators provide mechanisms for controlled
Q34: If a method does not have a
Q51: The relationship between a class and an