常用注解 @Configuration @ComponentScan @Scope @Lazy XML配置方式 @Configuration public class AnnotationConfig { @Bean public Person person(){ return new Person().setIdCard("123456"); } } public class Test { public static void main(String[] args) { AnnotationC…