- 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 - Which are the modules of Data Access/ integration layer?
Answer : A
Explanation
JDBC, ORM, OXM, JMS, Transactions are the modules of Data Access/ Integration layer.
Q 2 - Which of the statement is correct?
Answer : D
Explanation
All of the above statements are correct.
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.
Answer : A
Explanation
null and empty string values can be injected in spring beans.
Q 5 - What is Pointcut?
A - This represents a point in your application where you can plug-in AOP aspect.
B - This is a set of one or more joinpoints where an advice should be executed.
C - This is used to inject values in objects.
D - This is invoked during program execution by Spring AOP framework.
Answer : B
Explanation
Pointcut is a set of one or more joinpoints where an advice should be executed.
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 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 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.
Q 10 - Which of the following class can be used to call Stored Procedures in spring?
Answer : D
Explanation
SimpleJdbcCall class can be used to call Stored Procedures in spring.