

-
[武汉|结业弟子]JAVA-方广辉
0<!--依赖注入的方式-->
<!--constructor-arg:通过构造函数注入。-->
<!--property:通过setxx方法注入。-->public String getInfo(){
String info = "姓名:"+this.name+"\n年龄:"+this.age+"\n爱好:"+this.hobby+"\n朋友:"+this.friends+"\n婚否:"+this.ifMarried+"\n其他的:"+this.set;
return info;
}
xml配置文件<bean id="man" class="com.spring.test.man.Man">
<constructor-arg value="zzy" index="0" >
</constructor-arg>
<constructor-arg value="10" index="1">
</constructor-arg>
编辑于2018-05-18
- 去第 页