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 : D

Explaination

Session bean stores data of a particular user for a single session. It can be stateful or stateless. It is less resource intensive as compared to entity beans.

Q 2 - Which of the following bean is represents persistent data storage?

A - session bean.

B - entity bean.

C - message driven bean.

D - None of the above.

Answer : B

Explaination

Entity bean represents persistent data storage.

Answer : B

Explaination

messageListenerInterface attribute in @javax.ejb.MessageDrivenBean annotation is used to specify message listener interface for the message driven bean.

Q 4 - Which of the following annotation is used to specify or inject a dependency as ejb instance into another ejb?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : D

Explaination

@javax.ejb.EJB annotation is used to specify or inject a dependency as ejb instance into another ejb.

Answer : D

Explaination

@javax.ejb.Remote annotation is used to specify Remote interface(s) of a session bean. This remote interface states the business methods of the session bean (which can be stateless or stateful). This interface is used to expose the business methods to reote clients which are running in different deployment/application as EJB.

Answer : A

Explaination

@PostConstruct - method is invoked when a bean is created for the first time.

Answer : C

Explaination

Timer Service is a mechanism using which scheduled application can be build. This service is provided by Ejb container which helps to create timer and to schedule callback when timer expires.

Answer : C

Explaination

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

Answer : A

Explaination

Start - When to start a transaction in a business method.

ejb_questions_answers.htm
Advertisements