T getBean(String name, Class requiredType) throws BeansException;
T getBean(Class requiredType) throws BeansException;
Object getBean(String name, Object... args) throws BeansException;
bean中的id是不能重复的,那么classtype有什么用呢?
方便呗,,spring作为java框架No1,,装配方式也是多种多用,,
byname,bytype,,等,,这属于自动装配
题主这种, 通过 getBean获取的方式.....
多种方式都是为了方便。。。
Bean.class
例如Person.class