1

I have recently started with spring and I am facing problem in understanding this small code snipet.

@Component
public class A {

    @Autowired
    private B b;
}
@Component
public class B {
}

Since there are no setter methods provided and the field 'b' is private, how does spring perform this injection.

Arpit Agrawal
  • 321
  • 1
  • 2
  • 14
  • 1
    Private doesn't mean much once you delve into the [murky world of reflection](https://stackoverflow.com/a/1555680/3195526). – Paul Hicks Sep 28 '17 at 01:52

0 Answers0