adspace
What is the difference between constructor injection and setter injection?
Answer Posted / Ankita Srivastava
"Constructor injection involves injecting dependencies through a project's constructor, ensuring that an object is properly initialized. Setter injection, on the other hand, involves setting properties of an object after its creation by using setter methods. Both techniques are used for dependency injection in Spring Framework but have different implications for object initialization and accessibility."n
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers