1. 使用静态工厂方法创建Bean,用到一个工厂类 例子:一个Car类,有brand和price属性. package com.guigu.spring.factory; public class Car { private String brand; private double price; public Car(){ } public Car(String brand,double price){ this.brand=brand; this.price=price; } public S…