
- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 - User data can be saved to database via entity beans.
B - User data can be retrived from the database in the entity bean.
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 is true about stateless bean?
Answer : C
Explaination
A stateless session bean is a type of enterprise bean which is normally used to do independent operations. A stateless session bean as per its name does not have any associated client state, but it may preserve its instance state.
Q 3 - Which of the following is correct about mappedName 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 : 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 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 5 - 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.
Q 6 - Which of the following is true about callbacks in EJB?
A - Callback is a mechanism by which life cycle of an enterprise bean can be intercepted.
B - EJB Container calls callbacks.
C - We can define callback methods in the ejb class itself or in a separate class.
Answer : D
Explaination
Callback is a mechanism by which life cycle of an enterprise bean can be intercepted. EJB 3.0 specification has specified callbacks for which callback handler methods are to be created. EJB Container calls these callbacks. We can define callback methods in the ejb class itself or in a separate class. EJB 3.0 has provided many annotations for callbacks.
Q 7 - Which of the following is correct about @PostLoad annotation for a entity bean?
A - Method is invoked before an entity is to be updated in the database.
B - Method is invoked when a record is fetched from database and loaded into the entity.
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 : B
Explaination
@PostLoad - is invoked when a record is fetched from database and loaded into the entity.
Q 8 - Which of the following is correct about a transaction in EJB?
A - A transaction is a single unit of work items.
Answer : C
Explaination
A transaction is a single unit of work items which follows the ACID properties.
Q 9 - Which of the following is correct about a REQUIRED attrribute of Container Managed Transactions in EJB?
B - Indicates that a new transaction is to be started for the business method.
C - Indicates that business method will execute as part of transaction.
D - Indicates that business method should not be executed as part of transaction.
Answer : A
Explaination
REQUIRED - Indicates that business method has to be executed within transaction otherwise a new transaction will be started for that method.
Q 10 - Which of the following is true about JNDI?
A - JNDI stands for Java Naming and Directory Interface.
B - It is a set of API and service interfaces.
C - Java based applications use JNDI for naming and directory services.
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.