nerdexam
Oracle

1Z0-895 · Question #34

1Z0-895 Question #34: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-895 to reveal the answer and full explanation for question #34. The question stem and answer options stay visible for context.

Question

A developer writes a stateful session bean FooBean with two local business interfaces Foo and bar. The developer wants to write a business method called getBar for interface Foo that returns a Bar reference to the same session bean identity on which the client onvokes getBar. Which code, when inserted on line 12 below implements the getBar method with the wanted behavior? 10. @Resource SessionContext sessionCtx; 11. public Bar getbar () { 12. 13. }

Options

  • AReturn (bar) this;
  • BReturn (bar) new FooBarBean();
  • CReturn (bar) sessionCtx.lookup("FooBarBean")
  • DReturn (bar) sessionCtx.getBusinessObject(Bar.class);
  • EReturn (bar) session Ctx.lookup("java: comp/env/ejb/FooBarBean");

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.

Full 1Z0-895 Practice