Question: What effect does private static have on the object service below?

  1. The application will result in a compile error because you can't autowire a private variable.
  2. The application will compile and run, and service will have its dependency correctly injected by Spring.
  3. The application will compile and run, but service will not be autowired because you cannot autowire a static class member.
  4. The application will result in a compile error because you attempted to autowire a static variable.

Answer: The correct answer of the above question is Option C:The application will compile and run, but service will not be autowired because you cannot autowire a static class member.