Question no. 4
Given the following container-manager unidirectional relationship
Foo(0-1) -> Bar(0-1)
And the object realtions:
f1 -> b1
f2 -> b2
What will be true after the following code runs ?
f2.setBar(f1.getBar());
A. f1.getBar() == null;
B. b2.getFoo() == null;
C. b1.getBar() == null;
D. None of the above
I got the answer right first time. A & B.
But when I thought about it again can we have b2.getFoo(). It is a "unidirectional" relationship and Foo has a field for Bar. Can Bar have a field for Foo too?