spring-依赖入注

1.依赖注入

方法:

1.使用构造方法   value:基本类型:ref:spring 容器中注册过的类型

 

 

2.使用set/get方法

 

 

3.使用注解

posted @ 2022-03-28 17:02  吖?  阅读(12)  评论(0)    收藏  举报