benefit of @Autowired annotation in Java

后端 未结 4 1776
庸人自扰
庸人自扰 2021-02-14 01:01

Maybe, because of my wrong English, I couldn\'t understand the benefit of using @Autowired annotation.

According to the tutorial we can simplify the first(I.) case to se

4条回答
  •  半阙折子戏
    2021-02-14 01:46

    @Autowired tells Spring to find a bean of the declared type and wire in that bean, rather than requiring an explicit lookup by bean name. It can, under certain circumstances, make configuring applications easier if you only have one implementation of your types in a given Spring context.

提交回复
热议问题