Spring的依賴注入方式有三種:
構造器注入(Constructor Injection):通過在類的構造器中注入依賴對象來實現依賴注入。
Setter方法注入(Setter Injection):通過設置類的屬性的setter方法來注入依賴對象。
接口注入(Interface Injection):通過接口的方法來注入依賴對象。這種方式在Spring中已經不推薦使用。