- 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 of the following is correct assertion about spring?
A - Spring enables developers to develop enterprise-class applications using POJOs.
Answer : D
Explanation
Spring provides all above mentioned functionalities.
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 default scope of bean in Spring framework?
Answer : A
Explanation
singleton is the default scope of any spring bean.
Q 4 - What is no mode of autowiring?
A - Default setting which means no autowiring and you should use explicit bean reference for wiring.
B - Autowiring by property name.
D - Similar to byType, but type applies to constructor arguments.
Answer : A
Explanation
no mode of autowiring is the default mode which means no autowiring and you should use explicit bean reference for wiring.
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 - What are the different points where weaving can be applied?
Answer : D
Explanation
Weaving can be applied at Compile time, load Time and Run time.
Q 7 - What are the ways to access Hibernate by using Spring?
A - Inversion of Control with a Hibernate Template and Callback.
B - Extending HibernateDAOSupport and Applying an AOP Interceptor node.
Answer : C
Explanation
Hibernate can be accessed by both ways either using Inversion of Control with a Hibernate Template and Callback or extending HibernateDAOSupport and applying an AOP Interceptor node.
Answer : B
Explanation
SpEL is a part of core container.
Q 9 - How after advice works?
A - Run advice after a method execution regardless of its outcome.
B - Run advice after a class loads.
Answer : A
Explanation
after advice runs after a method execution regardless of its outcome.
Q 10 - What BeanPostProcessor does?
A - It processes beans once a bean is initialized.
Answer : B
Explanation
BeanPostProcessor defines callback methods that you can implement to provide your own instantiation logic, dependency-resolution logic etc.