![Spring Tutorial](/spring/images/spring-mini-logo.jpg)
- 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.
![Questions and Answers](/images/questions_and_answers.png)
Q 1 - What is true about cross-cutting concerns?
A - The functions that span multiple points of an application are called cross cutting concerns.
B - Cross-cutting concerns are conceptually separate from the application's business logic.
C - Logging is one of the examples of cross cutting concerns.
Answer : A
Explanation
Cross-cutting concerns are the functions that span multiple points of an application.
Q 2 - What is singleton scope?
A - This scopes the bean definition to a single instance per Spring IoC container.
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
singleton scope instructs Spring IoC container to create a single instance per IoC container.
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 constructor mode of autowiring?
Answer : D
Explanation
Constructor mode of autowiring is similar to byType, but type applies to constructor arguments. If there is not exactly one bean of the constructor argument type in the container, a fatal error is raised.
Q 5 - What is Advice?
A - This is the way to instruct object to behave in certain manner.
B - This is used to inject values in objects.
C - This is the actual action to be taken either before or after the method execution.
D - This is not invoked during program execution by Spring AOP framework.
Answer : C
Explanation
Advice is the actual action to be taken either before or after the method execution.
Q 6 - Which of the following aspect implementation spring supports?
A - XML Schema based aspect implementation
Answer : C
Explanation
Spring supports both XML Schema based and @AspectJ based aspect implementation.
Answer : B
Explanation
AOP is not the part of spring core container.
Q 8 - Which class acts as IoC Container?
Answer : C
Explanation
ApplicationContext class acts as IoC Container.
Answer : C
Explanation
Stateful bean is of prototype scope.
Answer : A
Explanation
Both values and ref can be injected at a time in a bean.