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

Spring supports Constructor based, Setter based injections.

Q 7 - How to get object of a service in spring framework?

A - Using new keyword

B - Using dependency injection

Answer : B

Explanation

In spring, dependency injection is used to get any object.

Q 8 - If a bean is scoped to HTTP request, scope is

A - session

B - global-session

C - prototype

D - request

Answer : D

Explanation

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

Q 9 - What is the scope of stateful bean?

A - session

B - global-session

C - prototype

D - request

Answer : C

Explanation

Stateful bean is of prototype scope.

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