- 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 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 bean is represents persistent data storage?
Answer : B
Explaination
Entity bean represents persistent data storage.
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 that a given ejb class is a message driven bean?
Answer : C
Explaination
@javax.ejb.MessageDrivenBean annotation specifies that a given ejb class is a message driven bean.
Q 5 - @javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.
Answer : B
Explaination
@javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.
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 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 - Which of the following is correct about a Consistent transaction in EJB?
B - A transaction must keep the system in consistent state.
C - Each transaction executes independent of any other transaction.
D - Transaction should survive system failure if it has been executed or committed.
Answer : B
Explaination
Consistent - A transaction must keep the system in consistent state.
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 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.
To Continue Learning Please Login
Login with Google