Spring Autowired Constructor Caveats

Here’s a little quiz about Spring autowiring. Given the following classes:

public class RightService {
    //...
}

public class WrongService {
    //...
}

public class MyBean {

    @Autowired
    public MyBean(RightService service) {
        //...
    }
}

Continue reading

Advertisements