nerdexam
Oracle

1Z0-860 · Question #263

Given this code snippet from a JMS message-driven bean class X: 11. public XQ { System, out. print("1 "); } 12. public void onMessagefMessage m) throws Java. rmi. RemoteException 13. try { 14…

The correct answer is F. This is NOT an EJB3.0 compliant bean. See the full explanation below for the reasoning.

Question

Given this code snippet from a JMS message-driven bean class X: 11. public XQ { System, out. print("1 "); } 12. public void onMessagefMessage m) throws Java. rmi. RemoteException 13. try { 14. TextMessage tm = (TextMessage) m; 15. String text = tm.getText0; 16. System, out. print("2 "); 17. } catch (JMSException e) { 18. throw new java. rmi. RemoteExceptionQ; 19.} 20.} When this bean class handles a message, which is correct?

Options

  • AAfter a message delivery the result is 1.
  • BAfter a message delivery the result is 2.
  • CAfter a message delivery the result is 12.
  • DAfter a message delivery an exception is thrown.
  • EAfter a message delivery the result is unpredictable.
  • FThis is NOT an EJB3.0 compliant bean.

How the community answered

(27 responses)
  • A
    4% (1)
  • C
    7% (2)
  • D
    4% (1)
  • F
    85% (23)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice