定义 定义一个方法,且该方法能够根据所传递参数对象的不同而具有不同行为; 代码 抽象基类 public abstract class Processor { public String name() { return getClass().getSimpleN