asbtract class A {
private String attr = "";
}
class B extends A {
@Value("${xxx}")
private String attr;
}
假如properties里面的xxx的值为“123”,配置了一个bean名叫a, a.attr的值是多少?“” 还是 “123”?
PHPz2017-04-18 10:13:52
I think it should be "", because member variables are statically bound, which means they are determined at compile time. The type of a at compile time is class A.