posted 17 years ago
4 - Give 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 returns (Choose all)
f2.setBar(f1.getBar());
A - f1.getBar() == null
B - b2.getFoo() == null
C - b1.getBar() == null
D - none of the above
OK, here are my comments:
C - wrong - it does not make sense since b1 has getFoo() instead of getBar().
D - wrong, because A is correct and makes sense!
At last, my question is about letter B.
- Why b2.getFoo() istn't equals to null since the b1 Bar object took its place over ?
Tks in advance!!
SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669