- 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 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 - 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 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.
Q 4 - What is byName mode of autowiring?
A - Default setting which means no autowiring and you should use explicit bean reference for wiring.
D - Similar to byType, but type applies to constructor arguments.
Answer : B
Explanation
byName mode of autowiring is autowiring by property name. Spring tries to match and wire its properties with the beans defined by the same names in the configuration file.
Q 5 - What is aspect?
A - Aspect is a way to do the dependency injection.
B - A module which has a set of APIs providing cross-cutting requirements.
C - Aspect is used to log information of application.
D - Aspect represents properties of spring based application.
Answer : B
Explanation
aspect module has a set of APIs to provide cross-cutting requirements.
Q 6 - How after-returning advice works?
A - Run advice after a class loads only if class loads successfully.
B - Run advice after a method execution only if method completes successfully.
C - Run advice after http response is returned only if http response is success.
D - Run advice after http request is processed with no exception.
Answer : B
Explanation
before advice runs after a method execution only if method completes successfully.
Q 7 - What is @Controller annotation?
A - The @Controller annotation indicates that a particular class serves the role of a controller.
B - The @Controller annotation indicates how to control the transaction management.
C - The @Controller annotation indicates how to control the dependency injection.
D - The @Controller annotation indicates how to control the aspect programming.
Answer : A
Explanation
The @Controller annotation indicates that a particular class serves the role of a controller.
Answer : B
Explanation
By default a bean is eagerly loaded.
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.
Answer : A
Explanation
Both values and ref can be injected at a time in a bean.
To Continue Learning Please Login
Login with Google