- 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 - What is Dependency Injection?
A - It is a design pattern which implements Inversion of Control for software applications.
B - It is one of the spring module.
Answer : A
Explanation
Dependency Injection is a design pattern which implements Inversion of Control for software applications.
Q 2 - Which is the way to provide configuration metadata to spring?
A - XML Based configuration file.
Answer : D
Explanation
All of the above statements are correct.
Q 3 - What is true about <map> collection configuration elements?
A - This helps in wiring a list of values, allowing duplicates.
B - This helps in wiring a list of values but without any duplicates.
Answer : C
Explanation
<map> tag is used to inject a collection of name-value pairs where name and value can be of any type.
Q 4 - What is bean autowiring?
B - Autowiring injects values in spring beans.
C - Autowiring injects one bean into another.
D - Autowiring helps in wiring a list of values, allowing duplicates.
Answer : A
Explanation
Using Bean autowiring, Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory without using <constructor-arg> and <property> elements..
Q 5 - What is ContextClosedEvent 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.
Answer : D
Explanation
This event is published when the ApplicationContext is closed using the close() method on the ConfigurableApplicationContext interface.
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 - Which ORM Spring supports ?
Answer : D
Explanation
Spring supports all the mentioned ORMs.
Q 8 - Expression Language/ SpEL was introduced in which version of spring framework.
Answer : C
Explanation
Expression Language/ SpEL was introduced in 3.0 version of spring framework.
Q 9 - How bean life cycle can be controlled?
B - Using InitializingBean class only
Answer : D
Explanation
Life cycle of a bean can be controlled using init() method or using InitializingBean / DisposableBean classes.
Answer : A
Explanation
Both values and ref can be injected at a time in a bean.
To Continue Learning Please Login
Login with Google