Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help :( ClassB and ClassA have no special relationship; they are two separa

ID: 663775 • Letter: N

Question

Need help :(

ClassB and ClassA have no special relationship; they are two separate classes both used by the same main().    void methodB( ClassA aObj ) is a method ofclassB. It takes a ClassA object as an ordinary parameter. The client, main(), calls  methodB().

Here is an outline of the situation:

Check all the true statements (Check all that apply):

A. If methodB() modifies aObj's someMemb, the client's myObjA's someMemb will also be modified, accordingly, when the method returns.
B. If methodB() modifies aObj's someMemb, the client's myObjA's someMemb will not be modified when the method returns.
C. methodB() can change aObj's someMemb value through direct assignment, as in aObj.someMemb = something.
D. methodB() can read (access) aObj's someMemb value directly without changing it, as in something =  aObj.someMemb.
E. methodB() can read from (access) and/or write to (change)  aObj's someMemb indirectly through appropriate public ClassA methods, if ClassA offers such methods.

Explanation / Answer

B. If methodB() modifies aObj's someMemb, the client's myObjA's someMemb will not be modified when the method returns.

C. methodB() can change aObj's someMemb value through direct assignment, as in aObj.someMemb = something

D. methodB() can read (access) aObj's someMemb value directly without changing it, as in something =  aObj.someMemb.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote