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?
Dependency Injection is a design pattern which implements Inversion of Control for software applications.
Q 2 - Which is the way to provide configuration metadata to spring?
All of the above statements are correct.
Q 3 - How can you inject Java Collection in Spring?
Spring supports list, set, map or props tags to inject java collections.
Q 4 - What is byName mode of autowiring?
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 ContextStoppedEvent event?
This event is published when the ApplicationContext is stopped using the stop() method on the ConfigurableApplicationContext interface.
Q 6 - What is Weaving?
Weaving is the process of linking aspects with other application types or objects to create an advised object.
Q 7 - How to get object of a service in spring framework?
In spring, dependency injection is used to get any object.
Q 8 - Which class acts as IoC Container?
ApplicationContext class acts as IoC Container.
Stateful bean is of prototype scope.
Q 10 - What is true about BeanPostProcessor?
BeanPostProcessor is an interface.