
- 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 EJB?
A - EJB is an essential part of a J2EE platform.
Answer : D
Explaination
EJB stands for Enterprise Java Beans. EJB is an essential part of a J2EE platform. J2EE platform have component based architecture to provide multi-tiered, distributed and highly transactional features to enterprise level applications. EJB provides an architecture to develop and deploy component based enterprise applications considering robustness, high scalability and high performance.
Q 2 - Which of the following is true about stateful bean?
A - EJB Container creates a separate stateful session bean to process client's each request.
B - As soon as request scope is over, statelful session bean is destroyed.
Answer : C
Explaination
EJB Container creates a separate stateful session bean to process client's each request. As soon as request scope is over, statelful session bean is destroyed.
Q 3 - Which of the following is correct about name 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 : A
Explaination
name attribute in @javax.ejb.Stateless annotation is used to specify name 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 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 @PrePassivate 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 : D
Explaination
@PrePassivate - method is invoked when a bean is put back to bean pool.
Q 7 - Which annoatation is used to inject SessionContext into an ejb?
Answer : B
Explaination
@Resource annotation is used to inject SessionContext into an ejb.
Q 8 - Which of the following is correct about @Embeddable annotation for a entity bean?
A - A java POJO to be embedded must be annotated as @Embeddable.
B - An entity bean to be embedded must be annotated as @Embeddable.
Answer : A
Explaination
A java POJO to be embedded must be annotated as @Embeddable.
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 true about System level exception in EJB?
Answer : B
Explaination
Any exception which is not caused by business logic or business code. RuntimeException, RemoteException are SystemException will be treated as system level exception.