How does @autowired annotation works for a private field?
It works with reflection. Here you can find an example of how to set public fields. But setting private fields does not make much of a difference
The only difference with a private field is that you will need to set the setAccessible before you are able to read/write to the field. Further, this method can throw a SecurityException. Java Docs