
- 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 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 entity bean?
A - This type of bean stores data of a particular user for a single session.
Answer : C
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 is correct about Entity 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 : A
Explaination
Entity is a persistent object representing the data-store record. It is good to be serializable.
Q 3 - 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 4 - 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 5 - 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 6 - Which of the following is correct about @PreDestroy annotation for a callback method?
A - Method is invoked when a bean is created for the first time.
B - Method is invoked when a bean is removed from the bean pool or is destroyed.
Answer : B
Explaination
@PreDestroy - method is invoked when a bean is removed from the bean pool or is destroyed.
Q 7 - Which of the following is correct about timer service in EJB?
A - Timer Service is a mechanism using which scheduled application can be build.
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.
Q 8 - Which of the following types of java classes can be mapped using @Lob annotation?
Answer : D
Explaination
All of the above classes can be mapped using @Lob annotation.
Q 9 - Which of the following is correct about a Failed 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 : C
Explaination
Failed - Identify failure scenario when a transaction is to be rollback.
Q 10 - Which of the following is correct about a DenyAll attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
Answer : D
Explaination
DenyAll - Indicates that business method is not accessible to any of user specified at class or at method level.