【C015401】在Spring的配置文件di.xml中,包含如下代码:
<bean id="testBean" class="test.TestBean">
<property name="dp" value="10" />
<property name="sp" value="mm" />
</bean>
则下列说法正确的是( )。
A.TestBean中一定有属性:private String sp = "";
B.TestBean中可能有方法:public void setSp(String value)
C.TestBean中如果有属性dp,其类型可能是int也可能是String
D.可以通过下列代码获取对象:
ApplicationContext context = new ClassPathXmlApplicationContext("di.xml");
TestBean t = (TestBean) context.getBean("test.TestBean");