Originally posted by Valentin Crettaz:
Jess,
how would you then access a private variable of one object from within another object of the same class if not from within an instance method? Just asking...
What gets passed to the method is a reference variable to the other PrivateAccess object. Within the method pa1 tries to access the private member of pa2. I thought that's what the question was asking...
I'll admit it -- not quite sure of what the question was getting at -- so instead of being helpful and providing an answer -- I decided to play Devil's Advocate and make sure your answer was correct.