Can I use two kinds of dependency injection in the same class?
i.e.
public class Test {
private ObjectTwo o2;
@Autowired // constructor injection
public Test(ObjectTwo o2 ) {
this.o2=o2;
}
@Autowired // field injection
private ObjectOne o1;
...
"using o1"
"using o2"
...
}
Related Question