- 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 Web layer?
A - WebSocket, Servlet, Web, Portlet
Answer : A
Explanation
WebSocket, Servlet, Web, Portlet are the modules of Web layer.
Q 2 - Which are the correct implementation classes of ApplicationContext?
A - FileSystemXmlApplicationContext, ClassPathXmlApplicationContext, WebXmlApplicationContext
B - FileSystemApplicationContext, ClassPathApplicationContext, WebApplicationContext
C - AdvancedApplicationContext, FileApplicationContext
D - FileSystemApplicationContext, ClassPathApplicationContext
Answer : A
Explanation
FileSystemXmlApplicationContext is the implementation class of ApplicationContext. Other mentioned classes do not exists.
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 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 ContextRefreshedEvent event?
A - This event is published when the Servlet Context is either initialized or refreshed.
B - This event is published when the HTTP Request is received.
C - This event is published when the HTTP Response is returned.
D - This event is published when the ApplicationContext is either initialized or refreshed.
Answer : D
Explanation
ContextRefreshedEvent event is published when the ApplicationContext is either initialized or refreshed.
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.
Q 7 - Which of the following is part of Data Access layer in Spring framework?
Answer : C
Explanation
JMS is the part of Data Access layer in Spring framework.
Answer : A
Explanation
Struts can be integrated with spring.
Q 9 - How to handle shut down of IoC container?
Answer : D
Explanation
Using registerShutdownHook() method, shut down of IoC container can be handled. Other methods do not exists.
Q 10 - What is a DispatcherServlet?
A - DispatcherServlet is used for transaction management.
B - DispatcherServlet is used for AOP.
C - DispatcherServlet handles all the HTTP requests and responses.
Answer : C
Explanation
DispatcherServlet handles all the HTTP requests and responses.
To Continue Learning Please Login
Login with Google