I was wondering what is the difference between the below solutions, why using solution 2? any benefits?
Solution 1:
public A {
@Autowire
private B b;
}
public B {
...
}
Solution 2:
public A {
private B b;
@Autowire
public A(B b) {
this b=b;
}
}
public B {
...
}```