Which of the Service implementations will be created first?
@SpringBootApplication
public class App {
@Autowired
Service service;
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
@Primary
@Component
class Service2Impl implements Service {
Service2Impl() {
System.out.println("Service2");
}
}
@Component("Service")
class Service1Impl implements Service {
Service1Impl() {
System.out.println("Service1");
}
}
interface Service{}