2020年12月10日-笔记

ioc

对象由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">
    <!--    使用spring创建对象,都称为一个bean-->
    <bean id="hello" class="com.gao.pojo.Hello">
<!--        value:具体的值-->
<!--        ref:引用spring中的对象-->
        <property name="str" value="Spring"/>
    </bean>
</beans>
posted @ 2020-12-10 17:51  丶ezio丶  阅读(63)  评论(0)    收藏  举报