请列举 Spring 中与 Bean 定义和配置相关的常用注解,并说明它们各自的作用。
考察说明
考察对 Spring 注解体系的理解和掌握程度
回答思路
- 准确列举 Bean 定义相关注解(如 @Component、@Service、@Repository、@Controller)
- 说明 @Configuration 与 @Bean 的配合使用
- 解释 @Autowired 与 @Resource 的区别
- 说明 @ComponentScan 和 @Import 的作用
本题已收录答题指导
本题附完整参考答案与评分标准
登录后可查看结构化答题指导;也可以直接开一场模拟面试,AI 面试官用本题实时追问并给出评分。