设计模式--创建型模式--简单工厂模式(Simple Factory)---"术业有专攻"
简单工厂模式(案例):
1.公用接口Salary
package com.design.simplefactory;public class Client { public static void main(String[] args){ Salary salary = SimpleFactory.createSalary("com.design.simplefactory.HeiBeiSalary"); salary.computerSalery(); salary = SimpleFactory.createSalary("com.design.simplefactory.BeiJingSalary"); salary.computerSalery(); }}