Kizspy | Question: 6
(Choose 1 answer)
Consider the following Java code snippet:
public class MyService {
private MyDependency dependency;
public void setDependency (MyDependency dependency) {
this.dependency = dependency;
}
public void performAction() {
dependency.doSomething();
Which Spring Core Container feature is being demonstrated in this code?
A. Aspect-Oriented Programming (AOP)
B. Dependency Injection (DI)
C. Resource Management
D. Event Handling