If vacation needs to play with a Friend object, perhaps it needs a Friend variable to hold the reference to the object? Also it needs a way to set that same Friend variable...
OK, so it sounds like my Vacation instance (trip) needs to have a Friend variable that I can use as a handle to get at the Friend (barney). I guess that makes sense (since I can't do what I thought I could - just walk over to the heap and ask it for what I want). But how do I get the barney info in there if I can't reference barney from trip?
Well, what if I do it from somewhere that I can reference both barney AND trip:
But, of course, this doesn't work - I get an "<identifier> expected" error on
trip.setLittleBuddy(barney);
Is that because I've botched the syntax somewhere, or is my whole idea just rubbish?