- 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 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.
Q 1 - Which of the following is true about EJB?
A - Simplified development of large scale enterprise level application.
Answer : D
Explaination
EJB provides all of the above mentioned benefits.
Q 2 - Which of the following bean stores data of a particular user for a single session?
Answer : A
Explaination
Session bean stores data of a particular user for a single session.
Q 3 - Which of the following is correct about EntityManager in EJB persistence API?
A - It is a persistent object representing the data-store record. It is good to be serializable.
C - It describes the properties of persistence mechanism.
D - It describes the data-store related properties like connection url. user-name,password etc.
Answer : B
Explaination
EntityManager is an interface to do data operations like add/delete/update/find on persistent object. It also helps to execute queries using Query interface.
Q 4 - 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 5 - 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 6 - Which of the following is correct about @PostRemove annotation for a entity bean?
A - Method is invoked when an entity is created in database.
B - Method is invoked after an entity is created in database.
C - Method is invoked when an entity is deleted from the database.
D - Method is invoked after an entity is deleted from the database.
Answer : D
Explaination
@PostRemove - method is invoked after an entity is deleted from the database.
Q 7 - Which of the following is correct about Default interceptor in EJB?
A - Such interceptor is invoked for every method of the bean.
B - Such interceptor is invoked for every bean within deployment.
C - Such interceptor is invoked for a particular method of the bean.
Answer : B
Explaination
Default interceptor is invoked for every bean within deployment.
Q 8 - What ACID stands for?
A - Atomic, Consistent,Isolated and Durable
B - Acurate, Correct,Isolated and Durable
Answer : A
Explaination
ACID stands for Atomic, Consistent,Isolated and Durable.
Q 9 - Which of the following is correct about a Success attrribute of Bean Managed Transactions in EJB?
A - When to start a transaction in a business method.
B - Identify success scenario when a transaction is to be committed.
C - Identify failure scenario when a transaction is to be rollback.
Answer : B
Explaination
Success - Identify success scenario when a transaction is to be committed.
Q 10 - Which of the following is correct about a RolesAllowed attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
Answer : B
Explaination
RolesAllowed - Indicates that a method can be accessed by user of role specified. Can be applied at class level resulting which all methods of class can be accessed buy user of role specified.