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 of the following is correct about dependency injection?
Dependency injection helps in decoupling application objects from each other.
Q 2 - Which of the statement is correct?
A - The AOP module provides aspect-oriented programming implementation allowing you to define method-interceptors and pointcuts to cleanly decouple code that implements functionality that should be separated.
All of the above statements are correct.
Q 3 - What is default scope of bean in Spring framework?
singleton is the default scope of any spring bean.
Q 4 - What is constructor mode of autowiring?
Constructor mode of autowiring is similar to byType, but type applies to constructor arguments. If there is not exactly one bean of the constructor argument type in the container, a fatal error is raised.
Q 5 - What is aspect?
aspect module has a set of APIs to provide cross-cutting requirements.
Q 6 - How after-returning advice works?
before advice runs after a method execution only if method completes successfully.
Q 7 - How to use ref keyword in beans.xml?
ref is used to reference already defined bean and it can be used using both setter method and constructor argument.
Q 8 - Expression Language/ SpEL was introduced in which version of spring framework.
Expression Language/ SpEL was introduced in 3.0 version of spring framework.
Id is not a mandatory attribute in beans configuration file.
Q 10 - What BeanPostProcessor does?
BeanPostProcessor defines callback methods that you can implement to provide your own instantiation logic, dependency-resolution logic etc.