EJB Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to EJB Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : B

Explaination

A remote session bean is used in EJB if ejb client is in different environment where ejb session bean is to be deployed.

Answer : C

Explaination

description attribute in @javax.ejb.Stateless annotation is used to provide description of the session bean.

Q 4 - Which of the following annotation is used to specify that a given ejb class is a message driven bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : C

Explaination

@javax.ejb.MessageDrivenBean annotation specifies that a given ejb class is a message driven bean.

Q 5 - Which of the following annotation is used to specify Remote interface(s) of a session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.Remote

D - @javax.ejb.EJB

Answer : C

Explaination

@javax.ejb.Remote annotation is used to specify Remote interface(s) of a session bean.

Answer : A

Explaination

@PrePersist - method is invoked when an entity is created in database.

Q 7 - Which annotation is used to inject an ejb into another ejb?

A - @EJB

B - @Resource

C - Both of the above.

D - None of the above.

Answer : A

Explaination

@EJB annotation is used to inject other EJB reference.

Answer : C

Explaination

A transaction is a single unit of work items which follows the ACID properties.

Answer : D

Explaination

NOT_SUPPORTED - Indicates that business method should not be executed as part of transaction.

Answer : A

Explaination

JNDI stands for Java Naming and Directory Interface.

ejb_questions_answers.htm
Advertisements