依赖:是Spring容器创造对象
注入:是Spring容器赋予变量值
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="address" class="com.kuang.pojo.Address"></bean>
<bean id="student" class="com.kuang.pojo.Student">
<!--value普通值注入-->
<property name="name" value="书季"></property>
<!--ref是引用对象注入-->
<property name="address" ref="address"></property>
<!--数组注入-->
<property name="books">
<array>
<value>红楼梦</value>
<value>西游记</value>
<value>水浒传</value>
</array>
</property>
<!--List注入-->
<property name="hobbys">
<list>
<value>听音乐</value>
<value>学习</value>
<value>工作</value>
</list>
</property>
<!---->
<property name="card">
<map>
<entry key="身份证" value="5002361999999"></entry>
<entry key="学号" value="33444"></entry>
</map>
</property>
<property name="games" >
<set>
<value>lol</value>
<value>3个字</value>
</set>
</property>
<!--为null-->
<property name="wife" >
<null></null>
</property>
<property name="info">
<props>
<prop key="driver">494150793@qq.com</prop>
<prop key="url">www.baidu.com</prop>
<prop key="username">shuji</prop>
<prop key="password">123456</prop>
</props>
</property>
</bean>
</beans>