建造者接口实现类:
package build;
//抽象的建造者,定义一些方法
public abstract class Builder {
abstract void bulidA(); //地基
abstract void bulidB(); //钢筋工程
abstract void bulidC(); //铺电线
abstract void bulidD(); //粉刷
//完工,得到具体的产品
abstract Product getProduct();
}
产品:
package build;
//产品:房子
public class Product {
private String builderA;
private String builderB;
private String builderC;
private String builderD;
public String getBuilderA() {
return builderA;
}
public void setBuilderA(String builderA) {
this