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.

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 - By default a bean is lazily loaded.

A - True

B - False

Answer : B

Explanation

By default a bean is eagerly loaded.

Q 9 - If a bean is scoped to HTTP session, scope is

A - global-session

B - session

C - prototype

D - request

Answer : B

Explanation

If a bean is scoped to HTTP session, scope is session.

Answer : B

Explanation

BeanPostProcessor defines callback methods that you can implement to provide your own instantiation logic, dependency-resolution logic etc.

spring_questions_answers.htm
Advertisements