工厂方法配置bean分为两种,一种是实例工厂方法,另一种是静态工厂方法. 先来看看实体bean: Car.java: package spring.beans.factory; public class Car { private String name; private int price; public Car(String name, int price) { super(); this.name = name; this.price = price; } public String ge…