viewing paste Unknown #27589 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12
ClassA has a method, void methodA( ClassA aObj ) , which takes, as a parameter, an object reference of the same ClassA.
 
There are no "sub-classes" (a topic from CS 1B we have not covered in CS 1A) involved.  ClassA is the only class in the discussion and is not derived from any other user-defined classes.)
 
Check all  the true statements. (Check all that apply):
 
 
 
    A.  If methodA() modifies a private instance member of its calling object (the this object), it will result in a simultaneous change of  the  corresponding private member in  the parameter object, aObj, even if aObj is a different object than the calling object.
    B.  If methodA() modifies a private instance member of the parameter object, aObj, it will result in a simultaneous change of  the  corresponding private member in  the calling object (the this object), even if aObj is a different object than the calling object.
    C.  methodA() can access private data of aObj directly, as in aObj.somePrivateMember = something, without the need for a public mutator or accessor.
    D.  methodA() can access private data of its calling object (the this object) directly, as in somePrivateMember = something, without the need for a public mutator or accessor and without the need to dereference anything.
Viewed 788 times, submitted by Guest.