
- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Web layer?
A - WebSocket, Servlet, Web, Portlet
Answer : A
Explanation
WebSocket, Servlet, Web, Portlet are the modules of Web layer.
Q 2 - Which is the correct implementation class of BeanFactory?
Answer : A
Explanation
XmlBeanFactory is the implementation class of BeanFactory. Other mentioned classes do not exists.
Q 3 - What is session scope?
A - This scopes a bean definition to an HTTP session.
B - This scopes the bean definition to Spring IoC container.
C - This scopes the bean definition to HTTP request.
D - This scopes the bean definition to HTTP Application/ Global session.
Answer : A
Explanation
session scope instructs Spring IoC container to create a instance per HTTP session.
Q 4 - What is autodetect mode of autowiring?
Answer : C
Explanation
In autodetect mode of autowiring spring first tries to wire using autowire by constructor, if it does not work, Spring tries to autowire by byType.
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 - What is Introduction?
A - An introduction represents a point in your application where you can plug-in AOP aspect.
B - This is used to inject values in objects.
C - This is not invoked during program execution by Spring AOP framework.
D - An introduction allows you to add new methods or attributes to existing classes.
Answer : D
Explanation
An introduction allows you to add new methods or attributes to existing classes.
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 - Thread scoped bean is introduced in which version of spring framework.
Answer : C
Explanation
Thread scoped bean is 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 - 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.