- 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 - 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 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 true about <props> 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 : A
Explanation
<props> tag is used to inject a collection of name-value pairs where name and value are both Strings.
Answer : A
Explanation
null and empty string values can be injected in spring beans.
Q 5 - What is RequestHandledEvent: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 session is initialized or refreshed.
D - This event is published when the HTTP Request is serviced.
Answer : C
Explanation
RequestHandledEvent event is published when the HTTP session is initialized or refreshed.
Q 6 - How after-throwing advice works?
A - Run advice after a method execution only if method exits by throwing an exception.
B - Run advice after a class loads only if class throws exception during load time.
C - Run advice after http response is returned with error status.
D - Run advice after http request is processed and an exception occurred.
Answer : A
Explanation
after-throwing advice runs after http request is processed and an exception occurred.
Q 7 - What are the types of the transaction management Spring supports?
A - Programmatic transaction management
Answer : C
Explanation
Spring supports both Programmatic and Declarative transaction management.
Q 8 - If a bean is created once per Ioc Container, scope is
Answer : A
Explanation
If a bean is created once per Ioc Container, scope is singleton.
Answer : B
Explanation
Id is not a mandatory attribute in beans configuration file.
Q 10 - What is true about BeanPostProcessor?
Answer : B
Explanation
BeanPostProcessor is an interface.