Oracle
1Z0-860 · Question #19
Given code snippets from two files: 7. public class Dog { 8. public void onMessage(Message m) { System, out. print("1 "); 9. 1 And 10. @MessageDriven 11. class MessageDog extends Dog implements…
The correct answer is A. Make class MessageDog public. B. Make the MessageDog constructor no-arg. C. Make the MessageDog constructor public. F. Make class MessageDog implement MessageListener instead of MessageDrivenBean. See the full explanation below for the reasoning.
Question
Given code snippets from two files: 7. public class Dog { 8. public void onMessage(Message m) { System, out. print("1 "); 9. 1 And 10. @MessageDriven 11. class MessageDog extends Dog implements MessageDrivenBean 12. MessageDog(Message m){ System, out. print("2 "); } 13.} Which four code changes, when used together, create a valid JMS message-driven bean? (Choose four.
Options
- AMake class MessageDog public.
- BMake the MessageDog constructor no-arg.
- CMake the MessageDog constructor public.
- DMove the onMessage method to class MessageDog.
- EChange MessageDog so that it is NOT a subclass of Dog.
- FMake class MessageDog implement MessageListener instead of MessageDrivenBean.
How the community answered
(50 responses)- A70% (35)
- D20% (10)
- E10% (5)
Community Discussion
No community discussion yet for this question.