- 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 true about cross-cutting concerns?
A - The functions that span multiple points of an application are called cross cutting concerns.
B - Cross-cutting concerns are conceptually separate from the application's business logic.
C - Logging is one of the examples of cross cutting concerns.
Answer : A
Explanation
Cross-cutting concerns are the functions that span multiple points of an application.
Q 2 - What is bean scope?
A - Bean scope forces Spring to produce a new bean instance as per the scope defined.
B - Bean scope defines the accessibility of bean in a java class.
C - Bean scope defines the accessibility of bean in a java package.
D - Bean scope defines the accessibility of bean in a web application.
Answer : A
Explanation
Bean scope instructs Spring Container to produce a new bean instance as per the scope defined.
Q 3 - What is request scope?
A - This scopes a bean definition to an HTTP request.
B - This scopes the bean definition to Spring IoC container.
C - This scopes the bean definition to HTTP Session.
D - This scopes the bean definition HTTP Application/ Global session.
Answer : A
Explanation
request scope instructs Spring IoC container to create a instance per HTTP request.
Q 4 - What is autodetect mode of autowiring?
Answer : C
Explanation
In autodetect mode of autowiring spring first tries to wire using autowire by constructor, if it does not work, Spring tries to autowire by byType.
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 - 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 - What is Spring MVC framework?
A - Spring MVC framework is Model-Value-Class architecture and used to bind model data with values.
C - Spring MVC framework is used for Transaction management for Web Applications.
D - Spring MVC framework is used for AOP for Web Applications.
Answer : B
Explanation
The Spring web MVC framework provides model-view-controller architecture and ready components that can be used to develop flexible and loosely coupled web applications.
Q 8 - Thread scoped bean is introduced in which version of spring framework.
Answer : C
Explanation
Thread scoped bean is introduced in 3.0 version of spring framework.
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 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.