在这个例子中,我们没有在被注入者中定义一个实例变量,而是定义了一个返回所需对象的抽象方法。
In this case we do not define an instance variable in the injectee, but an abstract method returning the required object. The method may be public or protected
是的,抽象的方法有返回类型,但实际上他们并没有任何回报,唯一的方法,实现了该接口的定义。
Yeah, abstract methods have a return type but they don't actually return anything, only methods which implements the interface they define.
应用推荐