- 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 Useful Resources
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 - What is Dependency Injection?
A - It is a design pattern which implements Inversion of Control for software applications.
B - It is one of the spring module.
Answer : A
Explanation
Dependency Injection is a design pattern which implements Inversion of Control for software applications.
Q 2 - Which is the way to provide configuration metadata to spring?
A - XML Based configuration file.
Answer : D
Explanation
All of the above statements are correct.
Q 3 - How can you inject Java Collection in Spring?
A - Using list, set, map or props tag.
B - Using lit, set, map or collection tag.
Answer : A
Explanation
Spring supports list, set, map or props tags to inject java collections.
Q 4 - What is no mode of autowiring?
A - Default setting which means no autowiring and you should use explicit bean reference for wiring.
B - Autowiring by property name.
D - Similar to byType, but type applies to constructor arguments.
Answer : A
Explanation
no mode of autowiring is the default mode which means no autowiring and you should use explicit bean reference for wiring.
Q 5 - What is ContextRefreshedEvent 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.
D - This event is published when the ApplicationContext is either initialized or refreshed.
Answer : D
Explanation
ContextRefreshedEvent event is published when the ApplicationContext is either initialized or refreshed.
Q 6 - What is Target object?
A - A represents a object in your application where you can plug-in AOP aspect.
C - This is used to inject values in objects.
D - This is not invoked during program execution by Spring AOP framework.
Answer : B
Explanation
Target object is advised by one or more aspects. Target object will always be a proxy object, also referred to as the advised object.
Q 7 - What is Spring MVC framework?
A - Spring MVC framework is Model-Value-Class architecture and used to bind model data with values.
C - Spring MVC framework is used for Transaction management for Web Applications.
D - Spring MVC framework is used for AOP for Web Applications.
Answer : B
Explanation
The Spring web MVC framework provides model-view-controller architecture and ready components that can be used to develop flexible and loosely coupled web applications.
Answer : B
Explanation
By default a bean is eagerly loaded.
Answer : C
Explanation
Stateful bean is of prototype scope.
Q 10 - What BeanPostProcessor does?
A - It processes beans once a bean is initialized.
Answer : B
Explanation
BeanPostProcessor defines callback methods that you can implement to provide your own instantiation logic, dependency-resolution logic etc.