Which two statements are correct when @SpringBootApplication is annotated on a class? (Choose two.)
Which two statements are correct when @SpringBootApplication is annotated on a class? (Choose two.)
When the @SpringBootApplication annotation is used on a class, it has two main effects. First, it enables auto-configuration by default, which means Spring Boot will automatically configure Spring application based on the dependencies found in the classpath (Option A). Second, it triggers component scanning starting from the package of the class on which it is annotated, scanning for Spring components such as @Controller, @Service, @Repository, and @Configuration (Option B). Other options are incorrect: @SpringBootApplication does not lead to all other annotations on the class being ignored, methods annotated with @Bean are not ignored, and normally only one ApplicationContext is created in a Spring Boot application.
A and B
Correct answer is AB. A reason why E is not a valid answer is because in typical Apring boot application, there will only be one ApplicationContext created however you can have multiple but this will lead to complication and unexpected behaviour to happen.
These are correct