面试突击78:@Autowired 和 @Resource 有什么区别?

@Autowired 和 @Resource 都是 Spring/Spring Boot 项目中,用来进行依赖注入的注解。它们都提供了将依赖对象注入到当前对象的功能,但二者却有众多不同,并且这也是常见的面试题之一,所以我们今天就来盘它。 @Autowired 和 @Resource 的区别主要体现在

你可能感兴趣的:(面试突击78:@Autowired 和 @Resource 有什么区别?)