用于注册方法返回值的容器。
@Bean注解是@Configuration注解所注解的类下的方法执行时所接受返回值的容器
@Configuration class MyFun { //@Bean注解是@Configuration注解所注解的类下的方法执行时所接受返回值的容器 @Bean public StudentModel getStudent() { System.out.println("create a student"); StudentModel student = new StudentModel(); student.setName("hhh"); return student; } }