Exam4Training

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

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

Exit mobile version