Originally posted by Hai Lin:
Hi, guys,
Feel big doubt for the HFE page 432, question 4
Given the container-managed unidirectional relationship:
Foo (0-1) --> Bar (0-1)
And the object relations:
f1-->b1
f2-->b2
What will be true after the following code runs? (Choose all the that apply.)
f2.setBar(f1.getBar());
A. f1.getBar() == null
B. b2.getFoo() == null
C. b1.getFoo() == null
D. none of the above
the answer given by the book is A, B. Actually, why B is correct? Since the Foo and Bar are unidirectional relationship, that mean, foo can getBar(), but bar cannot get Foo, there should NOT have method like b2.getFoo() existing.
Thanks a lot for your advice.
Hai
[ August 12, 2004: Message edited by: Hai Lin ]