Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain different types of dependency injection.
Answer:
There are two types of dependency injection in Spring Boot. They are as follows:
  • Constructor based dependency injection: It is a technique in which one class object supplies the dependency of another object.
  • Setter-based dependency injection: It is a dependency injection in which the framework injects the primitive and string-based values using setter method.
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook