3种方法
1。构造器注入
publicclassxx{
privateManagermanage;
publicxx(Managermanage){
this.manage=manage;
}
}
2.setter方法注入
publicclassxx{
privateManagermanage;
publicvoidsetManager(Managermanage){
this.manage=manage;
}
}
3.接口注入
publicinterfaceManager{
publicvoidmanage(Businessbusiness);
}
publicclassxx{
privateBusinessbusiness;
publicvoidmanage(Businessbusiness){
this.business=business;
}
}