• +91 9723535972
  • info@interviewmaterial.com

Spring Interview Questions and Answers

Question - Differentiate between constructor injection and setter injection.

Answer -

Constructor Injection vs Setter Injection

Constructor Injection

Setter Injection

There is no partial injection.

There can be partial injection.

It doesn’t override the setter property.

It overrides the constructor property.

It will create a new instance if any modification is done.

It will not create new instance if any modification is done.

It works better for many properties.

It works better for few properties.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners