- Spring Core Basics
- Spring - Home
- Spring - Overview
- Spring - Architecture
- Spring - Environment Setup
- Spring - Hello World Example
- Spring - IoC Containers
- Spring - Bean Definition
- Spring - Bean Scopes
- Spring - Bean Life Cycle
- Spring - Bean Post Processors
- Spring - Bean Definition Inheritance
- Spring - Dependency Injection
- Spring - Injecting Inner Beans
- Spring - Injecting Collection
- Spring - Beans Auto-Wiring
- Annotation Based Configuration
- Spring - Java Based Configuration
- Spring - Event Handling in Spring
- Spring - Custom Events in Spring
- Spring - AOP with Spring Framework
- Spring - JDBC Framework
- Spring - Transaction Management
- Spring - Web MVC Framework
- Spring - Logging with Log4J
- Spring Questions and Answers
- Spring - Questions and Answers
- Spring Useful Resources
- Spring - Quick Guide
- Spring - Useful Resources
- Spring - Discussion
Spring Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Spring 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 correct about dependency injection?
A - It helps in decoupling application objects from each other.
B - It helps in deciding the dependencies of objects.
Answer : A
Explanation
Dependency injection helps in decoupling application objects from each other.
Q 2 - What is bean scope?
A - Bean scope forces Spring to produce a new bean instance as per the scope defined.
B - Bean scope defines the accessibility of bean in a java class.
C - Bean scope defines the accessibility of bean in a java package.
D - Bean scope defines the accessibility of bean in a web application.
Answer : A
Explanation
Bean scope instructs Spring Container to produce a new bean instance as per the scope defined.
Q 3 - What is default scope of bean in Spring framework?
Answer : A
Explanation
singleton is the default scope of any spring bean.
Q 4 - How do you turn on annotation wiring?
A - Add <annotation-context:config /> to bean configuration.
B - Add <annotation-config /> to bean configuration.
C - Add <annotation-context-config /> to bean configuration.
Answer : D
Explanation
Add <context:annotation-config/> to bean configuration to turn on annotation wiring.
Q 5 - What is ContextClosedEvent event?
A - This event is published when the Servlet Context is either initialized or refreshed.
B - This event is published when the HTTP Request is received.
C - This event is published when the HTTP Response is returned.
Answer : D
Explanation
This event is published when the ApplicationContext is closed using the close() method on the ConfigurableApplicationContext interface.
Q 6 - What are the different points where weaving can be applied?
Answer : D
Explanation
Weaving can be applied at Compile time, load Time and Run time.
Q 7 - Which of the following is part of Data Access layer in Spring framework?
Answer : C
Explanation
JMS is the part of Data Access layer in Spring framework.
Q 8 - Expression Language/ SpEL was introduced in which version of spring framework.
Answer : C
Explanation
Expression Language/ SpEL was introduced in 3.0 version of spring framework.
Q 9 - If a bean can be created any number of times, scope is
Answer : C
Explanation
In prototype scope, a bean can be created any number of times.
Q 10 - What is ACID in transactional management?
A - Accurate, Controlled, Isolation, Durability
B - Atomicity, Consistency, Independent, Done
Answer : C
Explanation
ACID stands for Atomicity, Consistency, Isolation, Durability.
To Continue Learning Please Login
Login with Google