• +91 9723535972
  • info@interviewmaterial.com

Spring Interview Questions and Answers

Question - Which Is the Best Way of Injecting Beans and Why?

Answer -

The recommended approach is to use constructor arguments for mandatory dependencies and setters for optional ones. This is because constructor injection allows injecting values to immutable fields and makes testing easier.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners