- EJB Tutorial
- EJB - Home
- EJB - Overview
- EJB - Environment Setup
- EJB - Create Application
- EJB - Stateless Bean
- EJB - Stateful Bean
- EJB - Persistence
- EJB - Message Driven Beans
- EJB - Annotations
- EJB - Callbacks
- EJB - Timer Service
- EJB - Dependency Injection
- EJB - Interceptors
- EJB - Embeddable Objects
- EJB - Blobs/Clobs
- EJB - Transactions
- EJB - Security
- EJB - JNDI Bindings
- EJB - Entity Relationships
- EJB - Access Database
- EJB - Query Language
- EJB - Exception Handling
- EJB - Web Services
- EJB - Packaging Applications
- EJB Useful Resources
- EJB - Quick Guide
- EJB - Useful Resources
- EJB - Discussion
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.
EJB Mock Test II
Q 1 - Which of the following is correct about description attribute in @javax.ejb.Stateless annotation?
A - It is used to specify name of the session bean.
B - it is used to specify the JNDI name of the session bean.
Answer : C
Explaination
description attribute in @javax.ejb.Stateless annotation is used to provide description of the session bean.
Q 2 - Which of the following is correct about name attribute in @javax.ejb.MessageDrivenBean annotation?
A - It is used to specify name of the message driven bean.
B - it is used to specify message listener interface for the message driven bean.
D - It is used to specify the JNDI name of the message driven bean.
Answer : A
Explaination
name attribute in @javax.ejb.MessageDrivenBean annotation is used to specify name of the message driven bean.
Q 3 - Which of the following is correct about messageListenerInterface attribute in @javax.ejb.MessageDrivenBean annotation?
A - It is used to specify name of the message driven bean.
B - it is used to specify message listener interface for the message driven bean.
D - It is used to specify the JNDI 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.
Q 4 - Which of the following is correct about activationConfig attribute in @javax.ejb.MessageDrivenBean annotation?
A - It is used to specify name of the message driven bean.
B - it is used to specify message listener interface for the message driven bean.
D - It is used to specify the JNDI name of 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.
Q 5 - Which of the following is correct about mappedName attribute in @javax.ejb.MessageDrivenBean annotation?
A - It is used to specify name of the message driven bean.
B - it is used to specify message listener interface for the message driven bean.
D - It is used to specify the JNDI name 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.
Q 6 - Which of the following is correct about description attribute in @javax.ejb.MessageDrivenBean annotation?
A - It is used to specify name of the message driven bean.
B - it is used to specify message listener interface for the message driven bean.
D - It is used to provide description 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.
Q 7 - Which of the following is correct about name attribute in @javax.ejb.EJB annotation?
A - It is used to specify name which will be used to locate the referenced bean in environment.
B - it is used to specify the interface type of the referenced bean.
C - It is used to provide name of the referenced bean.
D - It is used to specify the JNDI name of the referenced 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.
Q 8 - Which of the following is correct about beanInterface attribute in @javax.ejb.EJB annotation?
A - It is used to specify name which will be used to locate the referenced bean in environment.
B - it is used to specify the interface type of the referenced bean.
C - It is used to provide name of the referenced bean.
D - It is used to specify the JNDI name of the referenced bean.
Answer : B
Explaination
beanInterface attribute in @javax.ejb.EJB annotation is used to specify the interface type of the referenced bean.
Q 9 - Which of the following is correct about beanName attribute in @javax.ejb.EJB annotation?
A - It is used to specify name which will be used to locate the referenced bean in environment.
B - it is used to specify the interface type of the referenced bean.
C - It is used to provide name of the referenced bean.
D - It is used to specify the JNDI name of the referenced bean.
Answer : C
Explaination
beanName attribute in @javax.ejb.EJB annotation is used to provide name of the referenced bean.
Q 10 - Which of the following is correct about mappedName attribute in @javax.ejb.EJB annotation?
A - It is used to specify name which will be used to locate the referenced bean in environment.
B - it is used to specify the interface type of the referenced bean.
C - It is used to provide name of the referenced bean.
D - It is used to specify the JNDI 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.
Q 11 - Which of the following is correct about description attribute in @javax.ejb.EJB annotation?
A - It is used to specify name which will be used to locate the referenced bean in environment.
B - it is used to specify the interface type of the referenced bean.
C - It is used to provide name of the referenced bean.
D - It is used to provide description 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?
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?
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?
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?
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?
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?
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?
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?
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.
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.
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.
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.
Answer : B
Explaination
@javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.
Q 24 - Which of the following is true about @javax.ejb.Local annotation?
A - @javax.ejb.Local annotation is used to specify Local interface(s) of a session bean.
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.
Q 25 - Which of the following is true about @javax.ejb.Remote annotation?
A - @javax.ejb.Remote annotation is used to specify Remote interface(s) of a session bean.
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 |
To Continue Learning Please Login
Login with Google