- 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 Web layer?
A - WebSocket, Servlet, Web, Portlet
Answer : A
Explanation
WebSocket, Servlet, Web, Portlet are the modules of Web layer.
Q 2 - What is bean scope?
A - Bean scope forces Spring to produce a new bean instance as per the scope defined.
B - Bean scope defines the accessibility of bean in a java class.
C - Bean scope defines the accessibility of bean in a java package.
D - Bean scope defines the accessibility of bean in a web application.
Answer : A
Explanation
Bean scope instructs Spring Container to produce a new bean instance as per the scope defined.
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.
Answer : A
Explanation
null and empty string values can be injected in spring beans.
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 - 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 - 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.
Answer : B
Explanation
SpEL is a part of core container.
Q 9 - What is the scope of stateless bean?
Answer : B
Explanation
Stateless bean is of singleton scope.
Q 10 - Following class can be extended to create custom event in spring.
Answer : C
Explanation
ApplicationEvent is used to create custom events.