Spring @Autowired usage

后端 未结 9 820
长发绾君心
长发绾君心 2020-12-04 04:51

What are the pros and cons of using @Autowired in a class that will be wired up by Spring?

Just to clarify, I\'m talking specifically about the

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 05:07

    For my understanding @Autowired is the best to use while refer to interface reference and use its override funtions, but I only find issue with this is that it sometimes assigned to null at runtime.

提交回复
热议问题