- 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 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 default scope of bean in Spring framework?
Answer : A
Explanation
singleton is the default scope of any spring bean.
Q 4 - What is bean autowiring?
B - Autowiring injects values in spring beans.
C - Autowiring injects one bean into another.
D - Autowiring helps in wiring a list of values, allowing duplicates.
Answer : A
Explanation
Using Bean autowiring, Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory without using <constructor-arg> and <property> elements..
Q 5 - What is true about @Autowired annotation?
A - The @Autowired annotation can be used to autowire bean on the setter method.
Answer : B
Explanation
@Autowired annotation provides more fine-grained control over where and how autowiring should be accomplished.
Q 6 - How before advice works?
A - Run advice before a class loads.
B - Run advice before a method execution.
Answer : B
Explanation
before advice runs before a method execution.
Q 7 - How to use ref keyword in beans.
xml?B - Using constructor argument only.
Answer : C
Explanation
ref is used to reference already defined bean and it can be used using both setter method and constructor argument.
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.
Answer : B
Explanation
Id is not a mandatory attribute in beans configuration file.
Q 10 - Which of the following class can be used to execute Sql queries in spring?
Answer : B
Explanation
JdbcTemplate class can be used to execute Sql queries in spring.