Free Oracle 1Z0-860 Exam Questions (page: 17)

Answer(s): D
QUESTION: 45
A developer wants to release resources within a stateless session bean class.
The cleanup method should be executed by the container before an instance of the class is
removed. The deployment descriptor is NOT used. Which three statements are correct?
(Choose three.)

A. The cleanup method may declare checked exceptions.
B. The cleanupmethodmusthave noarguments andreturn void.
C. The cleanup method isexecuted inan unspecifiedtransactionand security context.
D. The developer should mark the cleanup methodwiththe @PreDestroy annotation.
E. The developershouldmark thecleanupmethodwiththe @PostDestroy annotation.
F. Thecleanup method is executed inthetransactionandsecurity context ofthelast business
method invocation.
Answer(s): B, C, D
QUESTION: 46
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.

A. Make class MessageDog public.
B. Make the MessageDog constructor no-arg.
C. Make the MessageDog constructor public.
D. Move the onMessage method to class MessageDog.
E. Change MessageDog so that it is NOT a subclass of Dog.
F. Make class MessageDog implement MessageListener instead of MessageDrivenBean.
Answer(s): A, B, C, F
QUESTION: 47
A developer writes a stateless session bean FooBean with one remote business interface
FooRemote containing one business method foo. Method foo takes a single parameter of
application-defined type MyData.
11. public class MyData implements Java. io.Serializablej
12. int a; 13.}
Method foo is implemented within the FooBean class as:
11. public void foo(MyData data) {


18

Viewing page 17 of 108



Post your Comments and Discuss Oracle 1Z0-860 exam prep with other Community members:

1Z0-860 Exam Discussions & Posts