- 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 EJB?
A - Simplified development of large scale enterprise level application.
Answer : D
Explaination
EJB provides all of the above mentioned benefits.
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 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 annotation is used to specify Local interface(s) of a session bean?
Answer : C
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 @PreUpdate annotation for a entity bean?
A - Method is invoked before an entity is to be updated in the 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 : A
Explaination
@PreUpdate - method is invoked before an entity is to be updated in the database.
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 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 MANDATORY 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
MANDATORY - Indicates that business method will execute as part of transaction otherwise exception will be thrown.
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.
To Continue Learning Please Login
Login with Google