Oracle
1Z0-895 · Question #22
1Z0-895 Question #22: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-895 to reveal the answer and full explanation for question #22. The question stem and answer options stay visible for context.
Question
A developer writes a stateful session bean FooBean with one remote business interface Foo. Foo defines an integer / setter method pair implemented as: 10. private int value; 11. public void setValue (int i) {value = i; } 12. public int getValue () {return value; } A session bean ClientBean has a business method doSomething and an ejb-ref with ejb-ref-name "fooRef" that is mapped to FooBean's Foo interface. 11. @Resource private SessionContext SessionCtx; 12. public void doSomething () { 13. Foo foo1 = (Foo) sessionCtx.lookup("fooRef"); 14. Foo foo2 = (Foo) sessionCtx.lookup("fooRef"); 15. foo1.setvalue(1); Which statement is true after the code at line 15 completes?
Options
- AFoo1.getValue () = = 0 and foo2.getValue() = = 0
- BFoo1.getValue () = = 0 and foo2.getValue() = = 1
- CFoo1.getValue () = = 1 and foo2.getValue() = = 0
- DFoo1.getValue () = = 1 and foo2.getValue() = = 1
Unlock 1Z0-895 to see the answer
You've previewed enough free 1Z0-895 questions. Unlock 1Z0-895 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.