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.

Questions and Answers

Answer : A

Explanation

Dependency injection helps in decoupling application objects from each other.

Q 2 - Which is the correct implementation class of BeanFactory?

A - XmlBeanFactory

B - ClassPathBeanFactory

C - FileSystemBeanFactory

D - AdvancedBeanFactory

Answer : A

Explanation

XmlBeanFactory is the implementation class of BeanFactory. Other mentioned classes do not exists.

Q 4

Can you inject null and empty string values in Spring?

A - Yes

B - No

Answer : A

Explanation

null and empty string values can be injected in spring beans.

Answer : C

Explanation

ref is used to reference already defined bean and it can be used using both setter method and constructor argument.

Q 8 - Can we integrate Struts with Spring.

A - Yes

B - No

Answer : A

Explanation

Struts can be integrated with spring.

Answer : D

Explanation

Using registerShutdownHook() method, shut down of IoC container can be handled. Other methods do not exists.

Q 10 - Can we inject value and ref both together in a bean?

A - True

B - False

Answer : A

Explanation

Both values and ref can be injected at a time in a bean.

spring_questions_answers.htm
Advertisements