EJB Mock Test



This section presents you various set of Mock Tests related to EJB Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

EJB Mock Test II

Answer : C

Explaination

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

Answer : A

Explaination

name attribute in @javax.ejb.MessageDrivenBean annotation is used to specify name of the message driven bean.

Answer : B

Explaination

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

Answer : C

Explaination

activationConfig attribute in @javax.ejb.MessageDrivenBean annotation is used to specify the configuration details of the message-driven bean in operational environment of the message driven bean.

Answer : D

Explaination

mappedName attribute in @javax.ejb.MessageDrivenBean annotation is used to specify the JNDI name of the message driven bean.

Answer : D

Explaination

description attribute in @javax.ejb.MessageDrivenBean annotation is used to provide description of the message driven bean.

Answer : A

Explaination

name attribute in @javax.ejb.EJB annotation is used to specify name which will be used to locate the referenced bean in environment.

Answer : B

Explaination

beanInterface attribute in @javax.ejb.EJB annotation is used to specify the interface type of the referenced bean.

Answer : C

Explaination

beanName attribute in @javax.ejb.EJB annotation is used to provide name of the referenced bean.

Answer : D

Explaination

mappedName attribute in @javax.ejb.EJB annotation is used to specify the JNDI name of the referenced bean.

Answer : D

Explaination

description attribute in @javax.ejb.EJB annotation is used to provide description of the referenced bean.

Q 12 - Which of the following annotation is used to specify that a given ejb class is a stateless session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : A

Explaination

@javax.ejb.Stateless annotation specifies that a given ejb class is a stateless session bean.

Q 13 - Which of the following annotation is used to specify that a given ejb class is a stateful session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : B

Explaination

@javax.ejb.Stateful annotation specifies that a given ejb class is a stateful session bean.

Q 14 - 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 15 - 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.

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

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.Local

D - @javax.ejb.EJB

Answer : C

Explaination

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

Q 17 - 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.

Q 18 - Which of the following annotation is used to specify properties required for a message driven bean?

A - @javax.ejb.ActivationConfigProperty

B - @javax.ejb.Local

C - @javax.ejb.Remote

D - @javax.ejb.EJB

Answer : A

Explaination

@javax.ejb.ActivationConfigProperty annotation is used to specify properties required for a message driven bean.

Q 19 - Which of the following annotation is used to specify callback method of ejb lifecycle?

A - @javax.ejb.PostActivate

B - @javax.ejb.Local

C - @javax.ejb.Remote

D - @javax.ejb.EJB

Answer : A

Explaination

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

Q 20 - @javax.ejb.Local annotation is used to specify Local interface(s) of a session bean.

A - true

B - false

Answer : A

Explaination

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

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

A - false

B - true

Answer : B

Explaination

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

Q 22 - @javax.ejb.ActivationConfigProperty annotation is used to specify properties required for a message driven bean.

A - true

B - false

Answer : A

Explaination

@javax.ejb.ActivationConfigProperty annotation is used to specify properties required for a message driven bean.

Q 23 - @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

@javax.ejb.Local annotation is used to specify Local interface(s) of a session bean. This local 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 local clients which are running in same deployment/application as 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 Sheet

Question Number Answer Key
1 C
2 A
3 B
4 C
5 D
6 D
7 A
8 B
9 C
10 D
11 D
12 A
13 B
14 C
15 D
16 C
17 C
18 A
19 A
20 A
21 B
22 A
23 B
24 D
25 D
ejb_questions_answers.htm
Advertisements