- 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 is the correct implementation class of BeanFactory?
Answer : A
Explanation
XmlBeanFactory is the implementation class of BeanFactory. 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 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 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 - What is Target object?
A - A represents a object in your application where you can plug-in AOP aspect.
C - This is used to inject values in objects.
D - This is not invoked during program execution by Spring AOP framework.
Answer : B
Explanation
Target object is advised by one or more aspects. Target object will always be a proxy object, also referred to as the advised object.
Q 7 - Which of the following database is not supported using jdbcTemplate?
Answer : C
Explanation
NoSql is not supported using jdbcTemplate.
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 ACID in transactional management?
A - Accurate, Controlled, Isolation, Durability
B - Atomicity, Consistency, Independent, Done
Answer : C
Explanation
ACID stands for Atomicity, Consistency, Isolation, Durability.