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

Entity beans represents persistent data storage. User data can be saved to database via entity beans and later on can be retrived from the database in the entity bean.

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

mappedName attribute in @javax.ejb.Stateless annotation is used to specify the JNDI name 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 - @javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.

A - false

B - true

Answer : B

Explaination

@javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.

Answer : D

Explaination

@PrePassivate - method is invoked when a bean is put back to bean pool.

Answer : B

Explaination

Default interceptor is invoked for every bean within deployment.

Answer : C

Explaination

Failed - Identify failure scenario when a transaction is to be rollback.

Answer : D

Explaination

JNDI stands for Java Naming and Directory Interface. It is a set of API and service interfaces. Java based applications use JNDI for naming and directory services.

ejb_questions_answers.htm
Advertisements