- 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 message driven bean?
A - Message driven bean is a stateless bean.
Answer : D
Explaination
A message driven bean is a type of enterprise bean which is invoked by EJB container when it receives a message from queue or topic. Message driven bean is a stateless bean and is used to do task asynchronously.
Q 2 - Which of the following bean is invoked by EJB container when it receives a message from queue or topic?
Answer : C
Explaination
Message driven bean is invoked by EJB container when it receives a message from queue or topic.
Q 3 - 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 4 - 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 5 - @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 6 - Which of the following is correct about @PostPersist 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 : B
Explaination
@PostPersist - method is invoked after an entity is created in database.
Q 7 - Which annotation is used to inject an ejb into another ejb?
Answer : A
Explaination
@EJB annotation is used to inject other EJB reference.
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 Start 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 : A
Explaination
Start - When to start a transaction in a business 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.