Originally posted by Hai Lin:
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:
What will be true after the following code runs? (Choose all the that apply.)
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.
[ August 12, 2004: Message edited by: Hai Lin ]