首页 试题广场 > 试题详情
多选题

【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");
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 6个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部