Question: @SpringBootapplication public class Question14 { @Autowired private static Service service; private static void main(String[] args) { SpringApplication.run(Question14.class, args); @Component class Service {} The application will

@SpringBootapplication public class Question14 \{ @Autowired private static Service service; private static void main(String[] args) \{ SpringApplication.run(Question14.class, args); @Component class Service \{\} The application will result in a compile error because you attempted to autowire a static variable. The application will compile and run, but service will not be autowired because you cannot autowire a static class member. The application will compile and run, and service will have its dependency correctly injected by Spring. The application will result in a compile error because you can't autowire a private variable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
