标签:abstract public autowired blog autowire 抽象 子类 color int
public abstract class TestBean { private int a =0; }
public class TestBeanChild extends TestBean { int b = 1; public void execute() { System.out.println("132"); } }
<bean id="testBeanChild" class="com.yundaex.wms.config.TestBeanChild" />
@Autowired private TestBean a;
实际注入的是抽象类的子类
TestBeanChild,属性为a=0,b=1
标签:abstract public autowired blog autowire 抽象 子类 color int
原文地址:http://www.cnblogs.com/tonggc1668/p/7497930.html