- 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 - Which are the modules of Data Access/ integration layer?
Answer : A
Explanation
JDBC, ORM, OXM, JMS, Transactions are the modules of Data Access/ Integration layer.
Q 2 - What types of Dependency injection does spring supports?
A - Constructor based, Setter based
B - Constructor based, Setter based, Getter Based
Answer : A
Explanation
Spring supports Constructor based, Setter based injections.
Q 3 - What is prototype scope?
A - This scopes a single bean definition to have any number of object instances.
B - This scopes the bean definition to a single instance per HTTP Request.
C - This scopes the bean definition to a single instance per HTTP Session.
D - This scopes the bean definition to a single instance per HTTP Application/ Global session.
Answer : A
Explanation
prototype scope allows Spring IoC container to create any number instances per IoC container.
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 aspect?
A - Aspect is a way to do the dependency injection.
B - A module which has a set of APIs providing cross-cutting requirements.
C - Aspect is used to log information of application.
D - Aspect represents properties of spring based application.
Answer : B
Explanation
aspect module has a set of APIs to provide cross-cutting requirements.
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 @Controller annotation?
A - The @Controller annotation indicates that a particular class serves the role of a controller.
B - The @Controller annotation indicates how to control the transaction management.
C - The @Controller annotation indicates how to control the dependency injection.
D - The @Controller annotation indicates how to control the aspect programming.
Answer : A
Explanation
The @Controller annotation indicates that a particular class serves the role of a controller.
Q 8 - If a bean is scoped to HTTP request, scope is
Answer : D
Explanation
If a bean is scoped to HTTP request, scope is request.
Q 9 - How bean life cycle can be controlled?
B - Using InitializingBean class only
Answer : D
Explanation
Life cycle of a bean can be controlled using init() method or using InitializingBean / DisposableBean classes.
Answer : A
Explanation
Both values and ref can be injected at a time in a bean.