Solved

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

Question 8

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

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents