Which of the following statements is NOT true concerning Setter Injection or Constructor Injection? (Select one)

Posted by: Pdfprep Category: CoreSpringV3.2 Tags: , ,

Which of the following statements is NOT true concerning Setter Injection or Constructor Injection? (Select one)
A . Constructor injection is useful when you must have an instance of a dependency class before your component is used
B . Setter injection is useful if a component can provide its own defaults
C . Using the @Autowired annotation, setter injection also works when the setter method is private
D . Using setters promotes immutability

Answer: D

Leave a Reply

Your email address will not be published.