Spring Boot - Inversion of Control and Dependency Injection
Given the code below, what will be the output when
app.run() is called?@Component
public class App {
@Autowired
private ServiceA serviceA;
public void run() {
System.out.println(serviceA.getName());
}
}
@Component
public class ServiceA {
public String getName() {
return "ServiceA";
}
}